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   5974 Views

Avatar
nzjoel

Community Member, 26 Posts

28 April 2008 at 7:40pm

Edited: 28/04/2008 7:57pm

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

Forum Moderator, 5513 Posts

28 April 2008 at 8:07pm

Edited: 28/04/2008 8:59pm

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

Community Member, 26 Posts

28 April 2008 at 8:17pm

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

Forum Moderator, 5513 Posts

28 April 2008 at 8:21pm

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

Forum Moderator, 5513 Posts

28 April 2008 at 8:22pm

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

Avatar
nzjoel

Community Member, 26 Posts

28 April 2008 at 8:31pm

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

Avatar
Willr

Forum Moderator, 5513 Posts

28 April 2008 at 8:42pm

no worries, glad I can help :D

Avatar
nzjoel

Community Member, 26 Posts

28 April 2008 at 8:55pm

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