Create Custom RSS Feed With Views Module in Drupal

By default, Drupal only provides RSS feed for all the items on your front page. What should you do if you want to create RSS only for one specific taxonomy term?  Well, did you now that you can create custom RSS feed using Views module?

Before we move on, please download Views module first and the activate it (I’m sure you know how to do this, right?). Ok here’s how to do it.

  1. The first step we need to do is go to Administer -> Site building -> Views.
  2. You’ll see couple of tabs on the top of the Views page, click on the “Add” tab.
  3. Type a name for the Views (no space and only alphanumeric and under score “_” are allowed).
  4. The “Access” section is to identify which roles will be able to see this view. Just leave it unchecked.
  5. Type a short a Description for this view.
    Drupal RSS using views
  6. Now we go on the most important part, the “Page” section. Click on the “Page”, it will then opened and scrolled. Give a check mark on “Provide Page View”.
  7. On the URL, type “feed/DrupalCMS” (without quotes).
  8. On the View Type, select “View RSS: RSS feed”.
  9. Type a “Title” for it, e.g “Newest Articles on Drupal CMS”.
  10. Uncheck “Use Pager” and “Breadcrumb trail should not include Home” option.
  11. We go on to “Nodes per Page”, this option will determine how many article will be shown on the RSS feed, just type 10.
    Drupal RSS using views
  12. After finishing all the setting on the “Page” section, we’ll go on to the “Field”  section. This section will determine what field will be shown on the RSS Feed. For this tutorial, just add “Node: Title” and “Node: Body” to the list.Drupal RSS views field
  13. On the “Filters” section choose “Taxonomy: Term”, click on one of your taxomony term from the list, on this tutorial I have “Drupal” term in “Topics” vocabulary.Drupal RSS views filter
  14. Go on to the “Sort Criteria” section, and add “Node: Created Time” to the list, and don’t forget to change the “Order” from Ascending to Descending.Drupal RSS views sort criteria
  15. Click the “Save” button, and that’s it..you’re done.

If you followed the steps correctly, you can now se your new RSS feed from
http://www.yourdomain.com/feed/DrupalCMS

 

If you need to expand your knowledge on the Drupal CMS, you should buy this amazing Drupal step by step guide video including sample of Drupal site built from scratch.

Good luck :) .

10 Comments

  1. Thanks a lot for this, atleast i got to see RSS link :)

    Do you know of any good tutorials on how to publish rss feeds using drupal?

  2. Thanks for this tutorial, for some odd reason I’d never thought to do custom feeds using views. On our site, I’d been looking for a way to do both teaser-style AND full feed rss feeds, without much luck, until I ran into your site. Thanks!

  3. Really useful post. But there’s one final step missing, which is how to add that little “RSS feed” icon to go into your browser’s address bar (or wherever your browser puts it).

    There are probably many ways of doing this: here’s how I managed it. I created a block with some PHP code to add the RSS feed link into the HTML header. Remember to set the block to permit PHP code, and set the block to display only on the pages which you want to connect to this feed – which means the URL of your main view. I displayed my block in the header zone of my page – I don’t think it matters much. Here’s the code (substitute your preferred title and the full URL of the feed view that you just created using the contents of this post).

    "alternate",'type'=>"application/rss+xml",'title'=>"My RSS feed about something or other",'href'=>"http://www.mywebsite.com/feed/drupalCMS"));
    ?>

    Hope this helps someone!

  4. Not sure what happened to the code in the above post. The beginning got chopped off. Here’s another go, leaving out the PHP tags that surrounded it:


    drupal_add_link(array('rel'=>"alternate",'type'=>"application/rss+xml",'title'=>"My RSS feed about something or other",'href'=>"http://www.mywebsite.com/feed/drupalCMS"));

Leave a Comment.