would you really like fries with that?

Drupal - Troubles With RSS

I can't stress how important RSS is. Next to ranking high in search engines, it's the best (potential) source of traffic. Once a visitors subscribes, he's going to come back over and over again. I use it extensively as a user and I really care about it as a developer. Drupal's default implementation is very basic and every time I have to deal with it, I'm starting to look around for some solutions. In no particular order, here are the charges:
  • No control over what kinds of feeds are served. In general, software's default settings not suiting me are fine, as long as I can change them. Current page's feed depends on the location within the service - user clicking on RSS icon on some taxonomy term's page will only receive items from that category. Maybe I'm a bit paranoid, but I'm always afraid that I'm going to lose some visits this way - certain percentage of users will do this by mistake and won't notice it. It would be great if I could specify what kinds of feeds I provide - for example: main, all taxonomy terms, only terms alpha, betta, but not gamma. Usually, I only want to provide a main feed. I can think of three solutions, but both are a bit dirty:
    • Solution #1 - .htaccess. Create a 301 redirect ("moved permanently"). All unwanted feeds are redirected to rss.xml. Solution stinks because it requires messing with core files (which is a pita when upgrading to newer versions of Drupal).
    • Solution #2 - path module (it's bundled with Drupal). Create aliases for each term (rss.xml as the destination). It's a lot of work if you have many terms. Also it's easy to miss a few and not notice them.
    • Solution #3 - get rid of rss meta tag in your theme and provide a static link to RSS somewhere (header, footer, menu).
  • No control over which nodes get into the feed. Which content types (articles, forum topics, pages)? Only nodes promoted to the front page? Only published items? Solution: use a combination of views (to specify what gets into a feed) and path (to override original rss.xml). Create an RSS view (for example "only stories promoted to front page") with some URL (for example my_feed) and an alias that has my_feed as a source and rss.xml as destination.
  • Too little control over format. I don't want images in my feeds. I don't want links, either. And I have to live with it (have suggestions? drop a comment!).
  • No "local" settings. Sample situation: my friends are creating a cool news site about our city (Krakow News - it's in Polish) and I'm their tech slave. Normally, we only want teasers in feeds, but there are two partner sites that we exchange content with. One only shows linked titles, but the other one wants to display whole articles. And we can only have one global setting - so either we won't make a nice feed for the partner site, or we'll show full articles to visitors - which is something we don't want to do - we want them to click on the link, leave a comment and browse some more. We ended up with partner site's coder writing a script that parses our html, which is far from being a good solution.
Also, two minor issues (I don't consider the lack of those features to be Drupal's weakness - having them would be a nice addition, though).
  • Integration with FeedBurner. Because it's a cool service. I did it this way: I created a custom RSS view with a rss-source-for-feedburner URL and I "told" FeedBurner to use it. FeedBurner tells me to give http://feeds.feedburner.com/muszek URL to my visitors, but I don't really want to give them a URL that I don't control - what if I decide to change that URL in the future? Some of my subscribers will not update their aggregators. So instead, I give them my default feed's URL (http://www.muszek.com/rss.xml) and redirect to FeedBurner through .htaccess. A bit dirty, but works.
  • Click tracking. Wouldn't it be nice to know how many people really click on items, what nodes are particulary interesting to them, etc. It could be as simple as outputting links leading to rss.example.com/node/x. On this page, stuff would be written to the database and the browser would be redirected to the real URL.

My proposal

Now... I promised to only conduct a constructive criticim, so here's my functional specification of RSS module. Administration page (admin/content/rss-publishing) is divided into 3 blocks - global settings, settings for main feed, settings for node types, settings for taxonomy terms. The latter 3 groups override global settings.

global settings

  • number of items
  • titles only / titles plus teaser / full text
  • length of the teaser - site-wide teaser length setting is used when the field is left empty
  • strip html - checkbox - if checked, it makes "strip images" irrelevant
  • strip images
  • include only published nodes (checked by default)
  • include only promoted nodes
  • enable click tracking

settings for the main feed

  • include the following node types (I'd leave only "stories" checked by default):
    • story
    • page
    • forum thread
    • book
    • some user-created node type
  • override global settings (if checked, it reveals the submenu with all options from the "global" group)

settings for node types

  • provide a separate feed for the following node types (not checked by default):
    • story
    • page
    • forum thread
    • book
    • some user-created node type
  • override global settings (if checked, it reveals the submenu with all options from the "global" group)

settings for taxonomy terms

  • provide a separate feed for the following node vocabularies (check/uncheck all button would be nice):
    • user-created vocabulary #1 (check/uncheck all button would be nice):
      • term alpha
      • term beta
    • user-created vocabulary #2 (check/uncheck all button would be nice):
      • term gamma
      • term delta
  • override global settings (if checked, it reveals the submenu with all options from the "global" group)

additional notes

  • if "provide a separate feed for the following node types" is used, we'd need to create a place to display them (AFAIR there aren't any built-in pages dedicated to particular node types.
  • I think it's reasonable to include a link to the main feed on every page that doesn't have it's own feed (for example on taxonomy term pages if an admin chose to disable feeds on those pages)
  • A separate page with all available feeds would be nice.
Off course this is just a proposition - I don't claim it's either complete, intuitive enough for new users (the structure is clear to myself, but heck, I haven't been anyone else in a while ;) ). I think it provides much more flexibility and doesn't complicate the user experience too much. What do you think about it? I'd like to know your opinion - please post a comment!

Cool, I have similar needs

Cool, I have similar needs and your way would give me just what I need. I'd skip some details though, like separate settings for all tags - one global setting ("create feeds for taxonomy terms") would be enough.

Great writeup. now i would

Great writeup. now i would like to see it in core, or at least in contrib

I'm kind of new to Drupal.

I'm kind of new to Drupal. But, if I wanted what you want, I would simply edit the template for my theme and remove the feed insertion. Then I would create a custom block, and link to the feed or feeds I wanted to show throughout the site. In fact, I'm seriously thinking of doing this myself.

Yeah, I mentioned it near

Yeah, I mentioned it near the top of the post, but it solves just a few problems and creates new ones at the same time - for example you need to make manual patches every time you decide to change a theme or upgrade to a newer version of the one you use right now.

I have a drupal website setup

I have a drupal website setup and seems to be working just fine. I migrated it from my windows webserver to my unix server a while back without much issues.

On the UNIX server I chose to have the webserver use port 8001 instead the default port 80.

It appears that my rss feeds (from drupal) will not work on most rss readers due to the default port no being on port 80.

It works just fine on my windows webserver (still up and running using port 80)

Have you seen this issue before?

This doesn't sound like it's

This doesn't sound like it's specific to Drupal.
Have you tried including the port in feed's URL? Instead of yourdomain.tld/feed.xml you'd tell your client to get yourdomain.tld:8001/feed.xml .
Feel free to post your site's URL - I'll see if my RSS client (Liferea) handles your feed.

I use a page in the front

I use a page in the front page as an introduction text to the website. The stories go beneath.

In order to display only stories in your RSS feed, you can use the Views module. Use the existing front page emulator, and add the Node :: Type filter set to 'Stories'.

In addition, if the website is multilingual, you can add language filters set to "Current user language".


My favorite bands

Manu Chao
Massive Attack
Antonio Vivaldi
The White Stripes
Noir Désir

My favorite albums

Doolittle by Pixies
Surfer Rosa / Come on Pilgrim by Pixies
White Blood Cells by The White Stripes
Classical Masterworks CD39 by Vivaldi, Antonio
Animal Magic by Bonobo
666.667 Club by Noir Désir
Prymityw by T.Love
Mezzanine by Massive Attack
Classical Masterworks CD 6 by Albinoni, Tomaso
Pressure Drop, The Best Of ... by Toots & The Maytals

My favorite tracks

Wave of Mutilation by Pixies
Hey by Pixies
Here Comes Your Man by Pixies
Debaser by Pixies
I Bleed by Pixies
Dead by Pixies
Intro by Bonobo
Tame by Pixies
Monkey Gone to Heaven by Pixies
Lazy by Noir Désir


Free and open source software
KS Cracovia Kraków
Free Tibet
Massive Attack
The Clash
Thievery Corporation
Manu Chao

Recent comments