Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Blog Comment RSS feeds

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

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

Page: 1 2
Go to End
Author Topic: 5843 Views
  • nzjoel
    Avatar
    Community Member
    26 Posts

    Blog Comment RSS feeds Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Blog Comment RSS feeds Link to this post

    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

  • nzjoel
    Avatar
    Community Member
    26 Posts

    Re: Blog Comment RSS feeds Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Blog Comment RSS feeds Link to this post

    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!

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Blog Comment RSS feeds Link to this post

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

  • nzjoel
    Avatar
    Community Member
    26 Posts

    Re: Blog Comment RSS feeds Link to this post

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

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Blog Comment RSS feeds Link to this post

    no worries, glad I can help

  • nzjoel
    Avatar
    Community Member
    26 Posts

    Re: Blog Comment RSS feeds Link to this post

    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 ??????

    5843 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.