Understanding RSS On Your Drupal Site

Printer-friendly versionPDF version

RSS IconOne 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.

 

Bookmark and Share Bookmark or Share Post

Comments

Anonymous's picture

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.

learnbythedrop's picture

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.

Anonymous's picture

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.

Anonymous's picture

Ever Get This Working?

A late reply I know. I checked your site and it looks like you're no longer using Drupal.

Anonymous's picture

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.

Anonymous's picture

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))));
}

learnbythedrop's picture

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.

Anonymous's picture

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.

eric's picture

Re: Feed link for overridden front page

ditto on the thanks. this has been vexing me off and on for a while.

Anonymous's picture

Your recomendation?

Do you recommend using feedburner's service (via the feedburner module mentioned above) against drupal's own feed?

learnbythedrop's picture

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.

heplaysjazz's picture

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?

learnbythedrop's picture

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.

Anonymous's picture

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!

learnbythedrop's picture

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.

Anonymous's picture

Suppressing rss.xml Completely

I'm writing a custom module to suppress rss.xml completely. Right now it looks like this:

<?php
function 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! :)

learnbythedrop's picture
Anonymous's picture

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.

Anonymous's picture

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*

learnbythedrop's picture

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; ?>'

adam's picture

RE: RSS/Subscribe icons for learnbythedrop.com

I'm new to Drupal. How did you get the nice neat block of subscribe icons (rss, facebook, twitter, bookmark, email) onto the top right corner of your website? Its easy with joomla but I want to learn drupal6.

Cheers

Adam

adam's picture

solved!

Thankyou for the video! Create a block -> insert html with subscribe button pics and rss.xml feed as the first link, and links to facebook, twitter pages -> upload subscribe button pics -> click "full html" -> save!

... now to understand the bookmark and mail buttons.

Great resources here for us non-coders :)

learnbythedrop's picture

RE: RSS/Subscribe icons

Those icons are just image icons added to a block and then linked to the appropriate locations. There is no module involved.

drwasho's picture

Re: Understanding RSS On Your Drupal Site

Hey guys,

I run a website (http://www.themulewatch.com) and we'd like to have our front page content to be added to the central rss.xml. Unfortunately this doesn't seem to be happening, could somebody help me out?

Regards,

Drwasho

Anonymous's picture

Re: Understanding RSS On Your Drupal Site

Great Post...I was wondering if you knew how to handle something like this. I have some posts that are being being fed into the rss.xml. When I land on that page where someone could subscribe to the feed I noticed that when I click on the any one of the posts, they have a different url.

When we set up the site we created a different arbitrary domain for it and re-pointed the old server to the arbitrary domain but kept the old domain address. So for example:

We developed on dreamhost with a domain: new.domain.com and pointed the old site with the domain we wanted to keep - wanttokeepdomain.com

So the new and improved drupal site on dreamhost gets the old domain name. Now my links in the rss.xml are pointing to the arbitrary domain name: new.domain.com/article1 intsead it should be: wanttokeepdomain.com/article1

Is there anyway to change this? Sorry if I'm confusing!! I was just wondering if there is a way to change the linkage in the xml document. Sheww!

Thanks!!

learnbythedrop's picture

Re: Understanding RSS On Your Drupal Site

Instead of using the standard rss.xml you could use the views module to generate a feed. When you create the new view and feed there exists the ability to output the title field as a link. You could play with the settings in those options to try and redirect the link to the other domain.

Post new comment

Important
All comments on this site are moderated to prevent spam. Although we also use the Mollom module we have found that some gets through and that also affects people who have subscribed to email notifications. If you would like your comment to appear immediately please login with Google Friend Connect which supports your Google, Twitter or Yahoo account.
Google Friend Connect (leave a quick comment)
Loading
The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
Mollom CAPTCHA (play audio CAPTCHA)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.