Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Blog Comment RSS feeds


Go to End
Reply

11 Posts   5862 Views

Avatar
nzjoel

28 April 2008 at 7:40pm (Last edited: 28 April 2008 7:57pm), Community Member, 26 Posts

Hey,

Im wanting to know when I get comments on my blog, and as there isnt any kind of email notification when you get comments I was wanting to have a RSS feed for all my blog comments.

How do i hack my code to do this?

THANKS
~Joel

Avatar
Willr

28 April 2008 at 8:07pm (Last edited: 28 April 2008 8:59pm), Forum Moderator, 5511 Posts

we have been discussing the idea of email notification - theres a ticket on open about it assigned to me. I think and so do a few others that email is to invasive and so an RSS is the way to go. I have written up a little method that seems to work for me :D

Check it out at http://pastie.caboo.se/187947. Pretty simple function, just select the comments as dataobjects and output to an RSS feed!

I have that in the Page_Controller class and to view / subscribe its available at yoursite.com/home/commentrss.

If you have any improvements on it that would be great to hear!

EDIT: this is actually built-into silverstripes page comment class. I should have looked more throughly - Visit yoursite.com/PageComment/rss to see the latest comments. No need for custom code

Avatar
nzjoel

28 April 2008 at 8:17pm Community Member, 26 Posts

Hey Willr

That would be great if this feature was built in!

Could you please be a bit more specific on the instructions? Where do i paste the code from pastie etc?

Thanks

Avatar
Willr

28 April 2008 at 8:21pm Forum Moderator, 5511 Posts

just playing round but it might be nice for users to be able to subscribe as well I guess. If you want to add a little RSS icon in the browser window add this code to your Page_Controller -> init() function

RSSFeed::linkToFeed($this->Link() . "commentrss", "Latest Comments");

That will create a link in the <head> section to the commentrss feed and a nice little icon in the browser!

Avatar
Willr

28 April 2008 at 8:22pm Forum Moderator, 5511 Posts

Sorry paste that code in your Page.php file -> in the Page_Controller class.

Avatar
nzjoel

28 April 2008 at 8:31pm Community Member, 26 Posts

PERFECT! your a legend!
Thanks for the help! SO quick too :)

Avatar
Willr

28 April 2008 at 8:42pm Forum Moderator, 5511 Posts

no worries, glad I can help :D

Avatar
nzjoel

28 April 2008 at 8:55pm Community Member, 26 Posts

Oh no... when I go to my site it now says:

Fatal error: Cannot redeclare class RSSWidget in /home/.nevil/FOLDERNAME/MYSITE.net.nz/FOLDERNAME/blog/code/RSSWidget.php on line 44

?????? Whats up ??????

Go to Top