17488 Posts in 4473 Topics by 1978 members
Page: 1 2
|Go to End||Next >|
28 April 2008 at 7:40pm Last edited: 28 April 2008 7:57pm
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?
28 April 2008 at 8:07pm Last edited: 28 April 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
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
28 April 2008 at 8:17pm
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?
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!
28 April 2008 at 8:22pm
Sorry paste that code in your Page.php file -> in the Page_Controller class.
28 April 2008 at 8:31pm
PERFECT! your a legend!
Thanks for the help! SO quick too
28 April 2008 at 8:42pm
no worries, glad I can help
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 ??????
Page: 1 2
|Go to Top||Next >|