Complete and flexible blogging platform for ProcessWire

Render Comments RSS

The method renderCommentsRSS() renders an RSS feed of a limited number of your Blog Comments. The method can be called from any of your ProcessWire pages.

 * Render a limited number of comments RSS.
 * As seen on the frontend page: /blog/comments/rss/
 * @access public
 * @param int $limit
 public function renderCommentsRSS($limit) 

The method takes only one argument $limit which has to be an integer. If specified, it will limit the number of comments RSS rendered to the specified value. The method's usage is quite simple as shown below. Similar to the method renderRSS(), no futher markup should be output after calling this method as the RSS is output directly. Otherwise, you will get an error. Similarly too, the module RSS Feed Generator has to be installed for renderCommentsRSS() to work. It is a ProcessWire core module but may not be installed by default.

//first we call MarkupBlog
$blog = $modules->get('MarkupBlog');
$limit = 5;

if($input->urlSegment1) { 
          // rss feed
          if($input->urlSegment1 != 'rss') throw new Wire404Exception();

          //this is important: stops output of any other markup except the RSS xml

In the code above, we limit the number of comments in our RSS feed to 5. We use the URL segment '/rss/' to specify when we want the feed to be output. The output from the above code would be similar to the following.

<rss xmlns:dc="" version="2.0">
<title>- Code Tests</title>
<pubDate>Wed, 27 Aug 2014 20:36:41 +0100</pubDate>
<title>kongondo reply to: ProcessWire</title>
<![CDATA[ testing summbisls.s. ]]>
<pubDate>Fri, 22 Aug 2014 13:18:11 +0100</pubDate>


The method renderCommentsRSS($limit) renders an RSS feed of a limited number of our Blog Comments. Since it outputs the RSS directly, no further markup should be output once the method has been called.