Understanding RSS On Your Drupal Site
One of the best features of Drupal is the fact that the system generates many RSS feeds. RSS is great. It allows your visitors to subscribe to new content on your site in any number of ways. But sometimes the RSS capabilities of Drupal are a bit confusing to users. In this drop I'll do what I can to simplify the issue for you.
Front Page RSS Feed
Each Drupal site has a front page RSS feed that can be found at yoursite.com/rss.xml. This feed reflects items that have been promoted to the front page of your site. You can change the setting for this front page feed by going to admin/content/rss-publishing. Once there you can control the number of items in your feed. You can also change the setting for the RSS content by selecting Full Text, Titles or Titles Plus Teaser. Another benefit of the front page feed is the fact that current Internet Explorer and Mozilla browsers will auto-discover the feed when visitors arrive at the front page of your site.
Taxonomy Generated Feeds
If you categorize items on your site via the core taxonomy module then you will have a feed for every category that is active in your system. You can see how this works by clicking on any category in the sidebar or in the body of posts. The page you arrive at will display the name of the category at the top and a list of posts that include that category. Most themes will include an icon at the bottom of the page that links to the rss feed for the category which will look something like yoursite.com/taxonomy/term/17/0/feed. How the content in that feed is displayed is determined by the settings mentioned in the previous paragraph.
Views RSS Feeds
You can generate a wide variety of custom RSS feeds by utilizing the views module and views RSS. Creating RSS feeds from views may be a bit complicated for users new to the platform. But if you're looking for more control of exactly what gets published via RSS then this is the way to go. I recommend that you take a look at a Views RSS video tutorial that I created a few months ago to learn more.
RSS Related Modules
These are some interesting RSS related contributed modules that you can add to your Drupal site.
- Clean Feeds - This module cleans all the HTML tags from RSS Feeds that you provide on your site.
- RSS Remote Enclosure - RSS Remote Enclosure allows a user to attach a remote resource link to any node.
- Admin RSS - The AdminRSS module creates RSS feeds for the administrative information for Drupal websites.
- Feedburner - Integrates Drupal with the services provided by FeedBurner.
It is worth noting that of the modules listed above only Feedburner has been ported to Drupal 6 yet. But they all have versions for Drupal 5.
Podcast RSS Feeds
Yes, you can create a podcast with Drupal but there are limitations. If you upload a files using the core upload module then the first file that you upload will be included in the RSS as an enclosure. The present of the enclosure tag in the RSS feed allows people to download files automatically if they subscribe in iTunes or any other pod-catching software. It is worth noting that Drupal does not natively generate all the necessary iTunes tags that allow you to be listed in the iTunes podcast directory. Your best bet for adding the iTunes tags is to create a special feed using FeedBurner that you only submit to iTunes. This will help you get a listing in the directory but you can still include the original Drupal feed on your site.
Another option for generating an iTunes feed in Drupal 5 is the contributed Views Podcast module which I haven't tested but might be a better choice if FeedBurner is not an option. If podcasting with Drupal is of interest to you then I recommend reading a post I wrote elsewhere which is aptly titled, Podcasting With Drupal.
- learnbythedrop's blog
- 21478 reads


Comments
thanks but confused
Thanks for posting this. You are right. RSS with Drupal can be confusing. I've got a site and somehow managed to turn on RSS publishing. That's great. I have no idea how I did it, but it works, so that's fine. But, I just created a subdomain for my site and put up a bunch of content for the honor society at my school. I want to turn RSS publishing on for this as well, but I can't seem to figure it out no matter what I do. I changed the number of items and switched from w/teaser to w/o teaser to see if just playing with it would somehow trigger the RSS to start.
I also tried going directly to the subdomain and putting the rss.xml after the url but no dice. Any ideas?
I get this error message:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, support@supportwebsite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Activating RSS On Home Page
In order to activate the feed on the home page (aka yoursite.com/rss.xml) at least one node you have created must be promoted to the front page. If no nodes are promoted then the RSS link won't be valid. Try promoting one of your nodes on the subdomain to the front page and then check the feed.
RSS Feed isnt working for me
My front page RSS feed is functional to where http://www.digitalmlewis.com/rss.xml opens but nothing feeds. My blog entries are all defaulted as front page promotion. Any ideas on how to fix this issue? I am updated to the most up to date drupal install.
Thanks for any and all help in advanced.
Ever Get This Working?
A late reply I know. I checked your site and it looks like you're no longer using Drupal.
RSS Remote Enclosure
An intrepid member of the community has created a patched release for the remote enclosures module that makes it valid for Drupal 6. http://drupal.org/node/256954
This module is particularly useful if you host media on another site and want to publish via your Drupal site and support podcasting.
Feed link for overridden front page
Nice summary.
I've noticed that when overriding Drupal's front page the default feed link does not appear in the head section of the new front page - e.g. when using a node as your front page.
Adding the following to template.php puts it back so your browser can auto-discover the feed (plus you get a nice icon in the address bar!):
if (drupal_is_front_page()) {
drupal_add_link(array('rel' => 'alternate',
'type' => 'application/rss+xml',
'title' => variable_get('site_name', 'Drupal') .' '. t('RSS'),
'href' => url('rss.xml',array('absolute' => TRUE))));
}
Nice Snippet
Thanks for that snippet Terry. I think you could also add the piece of meta data below to the
section of the new front page template.link rel="alternate" type="application/rss+xml" title="Learn By The Drop RSS" href="http://learnbythedrop.com/rss.xml"
That would need to be wrapped inside < /> in order to work.
Thanks for this
Your code fixed me up just fine, thank you!
I change nodes from time to time to serve as Drupal's front page so my front page feeds weren't working, no RSS in the browser bar. Added the code to themes.php and all is well.
Thanks for posting!
And to site owner -- thanks for a great site as well.
Your recomendation?
Do you recommend using feedburner's service (via the feedburner module mentioned above) against drupal's own feed?
Using Feedburner
My answer may frustrate you. It depends. I find that FeedBurner is worthwhile for three main things. First, it helps make for easier integration with podcasts if you want to be listed in iTunes. Second, you get good feed subscription statistics. Finally, you get really simple subscription to your feed content via email. If none of those things are too important to you then the Drupal feeds work fine.
What triggers a feed update?
Many thanks for your excellent tutorial with which I was able to create an RSS feed from one of my existing view page's displays. I shall be coming back to your site, you can be sure. I still need to do a bit of work on how the attached RSS symbol is styled as I feel it needs some pointing up to viewers of the site (http://www.sociologyoftheuniverse.net).
My question is: when do RSS subscribers receive feed updates? e.g. I added a comment on one of the pages shown in the view but subscriber received no update; I edited the body of one of these pages but still no update sent.
Is the update a side-effect of the cron processing? What changes trigger an update?
RSS Updates
The timing of RSS updates depends on the type of feed reader that a person is using. As soon as you add new content on your site the new feed will be available to the reader that each subscriber is using. Now I use Google Reader and I think that what Google Reader does is check a feed for new items at least every thirty minutes or so. Some non web-based feed readers will check for updates when they are opened up, like Outlook checks for email. Most feed readers allow users to manually refresh if they want to in order to grab the latest content. Cron is not involved or necessary in that process.
In your comment you mention adding a comment on your site and then expecting a feed update. If you create a feed on your Drupal site, the comments won't affect that feed. If you wan't people to be able to subscribe to comments then you should try the Comment RSS module. http://drupal.org/project/commentrss
Alternatively, you can add a module like I've got on this site which is called Comment Notify. This module allows people to subscribe to comment via email. http://drupal.org/project/comment_notify
The key thing to understand is that the feed that contains the content you place in your posts WILL NOT get updated when someone makes a comment. You can update the feed by adding another post. One of the two methods I mentioned above will allow people to get updates to comments on your posts.
Feed link for overwritten front_page to only authenticated??
Taking the code from both Terry Child above as well as the additional rel statement I have the feed code showing on all pages; which I wanted.
BUT; in the original post there was a comment "if (drupal_is_front_page())".
Is there such code that I could use to indicate "if (user authenticated())"?
This way anonymous users would not be able to subscribe to the feed easily ;).
My internet searches tell me I'd have to use another theme (even if it's a duplicate of my existing) and anonymous users use one theme and registered users use the other theme, but is this the 'best' way to do this?
TIA! Thanks In Advance!
Feed for Authenticated Users
The following link has a code snippet that may work. http://drupal.org/node/618490 The other option is to put the feed link in a block and make that only visible to authenticated users by using the "show block for specific roles" setting.
Suppressing rss.xml Completely
I'm writing a custom module to suppress rss.xml completely. Right now it looks like this:
<?phpfunction suppressrss_menu_alter(&$items) {
unset($items['rss.xml']);
}
However, this doesn't remove the <link> tag from the header, which means browsers will still show an RSS chiclet in the address bar, and spiders will encounter a 404 error, potentially hurting your SEO. Can you recommend a solution for removing this? Thanks! :)
Removing RSS Autodiscovery
Have you checked out http://industriousone.com/one-feed-rule-them-all?
Re: One Feed to Rule Them All
Regular expressions, huh? Well, it's better than nothing. Perhaps we'll get a hook or an option in a later version of Drupal.
RSS icons in different themes
Hello there - I have noticed that in some themes the RSS icon doesn't display as a default on the front page and on the blogs pages. is there any work around to put this back into such themes?
I'm working with marinelli at the moment.
K*
Adding RSS Icons
You could add the code to the theme file that tells the feed icon to show up. The code is something like this. '<?php print $feed_icons; ?>'
Post new comment