How to use Views 3 and Panels to create a RSS feed for comments for each node

Last updated on
1 December 2016

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

Here is my way of creating a RSS feed that displays for each page or node for the comments on that specific page. The use case for such a senario would be replicate the functionality provided by Comment RSS module that doesnot have a Drupal 7 version.
Requirements:
1. Views 3
2. Panels styling the node (use the node template provided with panels).

Step 1 : Goto Administration > Structure > Views and create a new view. Label the view what you want (I called mine Comment Feeds). In Show, select Comments from the drop down, and let the sort order be latest comment;
Step 2: Check the checkbox include an RSS feed;
Step 3: Click on Continue and Edit.

In the new view created, check the feeds display to check if the feed is appearing in the preview area. This should display all the comments that have been made for all content in your site. In order to restrict the comment feed to display only comments related to a particular node, click on contextual filters, and select Content: Content nid from the list and click on save. You can also change the comment feed path to content/%/feed which essentially means that the url for the feed will be modified according to the content being viewed. Click on Save. Make sure your feed is attached to the page.
In the page display, change the Format to Unformatted Fields, and, in show, change comments to fields. We just want that feeds to display, so what I did was change this page. Since you cannot have the feed without at least one field displaying, I chose to display the comment count. Click on fields, and select Content: Comment Count. Make sure you have overridden the display style for only the page; you don't want the feed to change its display settings. Remove the title field to display only the comment count. In the pager section, change from paged display to restrict display to a single item.

Go to the panel variant for the content type you want the RSS feed to appear on. Go to the content section and decide which region you want to add this view to. I choose to display this below comments section and above the comment form. Click on the small gear icon on the left at the top of the region and select views. Choose the view you want to include which would be the Comment Feed View in my case.

Choose the page as the display type and click on submit. The next dialog that appears make sure you choose in the context drop down Content Id in order to restrict the view to display items for the specific node. You can choose the title for this (if you want no extra title type in ).

Click on save and update, and each and every node of that particular type will now have a nice orange RSS icon attached to page.

Enjoy.

Help improve this page

Page status: No known problems

You can: