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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

Blog Comment RSS feeds


Go to End


6 Posts   6459 Views

Avatar
Willr

Forum Moderator, 5523 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
Willr

Forum Moderator, 5523 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, 5523 Posts

28 April 2008 at 8:22pm

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

Avatar
Willr

Forum Moderator, 5523 Posts

28 April 2008 at 8:42pm

no worries, glad I can help :D

Avatar
Willr

Forum Moderator, 5523 Posts

28 April 2008 at 8:57pm

Should have probably checked this early but it appears viewing all comments IS actually an option thats in the core. You just need to view - yoursite/PageComment/rss. No need for custom code yays!

Avatar
Sean

Forum Moderator, 922 Posts

30 April 2008 at 5:15pm

Thankfully this was documented on the wiki too, so no digging around the forum:

http://doc.silverstripe.com/doku.php?id=rssfeed