Giving out custom RSS from your Drupal Site
Recently I ran into a problem where by I had to give out RSS of the Forum only from a DRUPAL 5 site, as the website was forum centered but it had blogs also. So when I first used the default rss.xml like (http://somesite.com/rss.xml) it gave out all the update not only the updated of the Forum that I wanted. I even tried another RSS source http://somesite.com/forum/rss.xml but it also had the same output. So problem is: giving out RSS of Forum only, how to do that?
Then I was suggested to use the views module, I said to myself views how will it do that? But I was not using the "Arguments" part of views there was the trick. Read the steps below if you want to do it yourself as well:
What can it be used for only some possibilities:
There can be numerous possibilities with RSS of views. I got my problem solved hope you also benefit from it.
Geshan Manandhar
Then I was suggested to use the views module, I said to myself views how will it do that? But I was not using the "Arguments" part of views there was the trick. Read the steps below if you want to do it yourself as well:
- Assumed you have views installed, login as the administrator (user1) or user with access to edit views.
- Goto Administer>>(under Site Buliding) Views>>Add
- In the new view configuration do something like below:
- Type the name of the view, I gave forum_rss, and specify access if you want to or give a description.
- In the page section choose something like below, give url it'll be yoursite.com/forum_rss.
- Skip the header, footer, empty text, menu and block sections.
- In the fields section add "Node Title" and "Node Body" if you want to add more its fully your choice, see below:
- The main step to get the RSS feed is here in the "Arguments" section, choose "RSS: RSS feed selector and click "Add Argument", then specify "Display all Values" and your feed's title as below.
- Use following filter in the filters section, I've used content type "Forum" and other needed filters.
- Select a sort criteria like below (new items first) then click save.
- Go to the new view page create and get your RSS feed's URL.
- The main trick lies in "Arguments" segment, when you add an argument choose "RSS: RSS Feed Selector" and display all values in default when it is added.
- Then see the view you have a RSS feed icon at the bottom of the page or
you can get your custom RSS feed at http://somesite.com/page_view_url/feed.
What can it be used for only some possibilities:
- Giving out RSS of selective content type like blogs, forum or even you own CCK made content type.
- Giving out custom RSS of some vocabulary (tag) or any view customizable content like RSS of content tagged with Drupal.
There can be numerous possibilities with RSS of views. I got my problem solved hope you also benefit from it.
Geshan Manandhar