Remember me? forgot password | register

SilverStripe Forum

4683 Posts in 1048 Topics by 664 members

Jump to:

Extending and hacking

If this is your first visit, you will need to register before you can post. However, you can browse all messages below.

Community » SilverStripe Forum » Extending and hacking » Blog Comment RSS feeds
Page: 1 , 2 go to end Reply
Author Topic: Blog Comment RSS feeds 2568 views
  • nzjoel
    nzjoel's avatar
    Community Member
    19 posts
    1 SilverStripe Theme

    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

    Last edited: 28 April 2008 at 7:57pm

  • willr
    avatar
    Core Development Team
    1263 posts
    3 SilverStripe Sites 2 SilverStripe Themes

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

    Last edited: 28 April 2008 at 8:59pm

  • nzjoel
    nzjoel's avatar
    Community Member
    19 posts
    1 SilverStripe Theme

    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
    Core Development Team
    1263 posts
    3 SilverStripe Sites 2 SilverStripe Themes

    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
    Core Development Team
    1263 posts
    3 SilverStripe Sites 2 SilverStripe Themes

    Re: Blog Comment RSS feeds Link to this post

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

  • nzjoel
    nzjoel's avatar
    Community Member
    19 posts
    1 SilverStripe Theme

    Re: Blog Comment RSS feeds Link to this post

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

  • willr
    avatar
    Core Development Team
    1263 posts
    3 SilverStripe Sites 2 SilverStripe Themes

    Re: Blog Comment RSS feeds Link to this post

    no worries, glad I can help :D

  • nzjoel
    nzjoel's avatar
    Community Member
    19 posts
    1 SilverStripe Theme

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

    2568 views
go to top Reply

Currently Online:

kudesign, simon_w

Welcome to our latest member: patrics