Drupal has a lot of methods for showing RSS urls. But by default /node is the only feed that shows up as alternative
<link rel="alternate" type="application/rss+xml" title="RSS" href="node/feed" />
This is far too limiting IMO. We should have a unified method for showing alternative urls, and the [xml] button.

my proposal:
on each and every url look for:
/feed/theurl/

if that returns a feed, make that the <link rel="alternate" header, either instead of, or in addidion to the standard RSS url.

that should go in combination with a _feed hook. The feed hook could look like (its psuedo code, just to show the idea):

function taxonomy_feed($op='header', $url=NULL) {
  $operator = arg(2);
  if($op='rss') {
   $output = taxonomy_make_feed($operator);
  }
  elseif($op = 'header') {
    if(taxonomy_feed_has_items($operator)) {
      $output = '<link rel="alternate" type="application/rss+xml" title="RSS" href="feed/'. $url .'" />;
    }
  }
  return $output;
}

If anyone else sees better options to unify and centralise the feed and feed-header generation, please suggest them.

Comments

drumm’s picture

My plan is to unify all node listing pages to be handled by a single system. There can be a system to hook into that for alternative views and blocks. RSS, ATOM, and archive browsing are the obvious alternative views for me. I would probably make the URLs consistent with the current system for the front page, appending /feed for rss. This happens to work well with menu hierarchy idea as well. I doubt I will have time for this in the next month or so, and I already have one pending 100+ line patch and 4 others.

Bèr Kessels’s picture

http://drupal.org/node/9167 discusses something similar

Bèr Kessels’s picture

This is a proposal for a feedcentral I made. IMO thats the way this should be handled.

RFC FeedCentral

Components
----------
Feed.module
hook_feed

Features
--------
Every registered feed will show up in the headers
Every registered feed will show up on a central page
Every registered feed will be appended to a dynalic feed block.

Blocks
------
Simple block: Shows only an icon to /node/feed
Dynamic block: Shows an icon if the page viewed has a registerd feed. Icon links
to that registered feed. More than one icon will show up, if more feeds are
registered at that page.
Advanced Block: icon with link to /node/feed. Icons of registered feeds (max 5);
more lin pointing to centrql page.

Central page
------------
Shows all registerd feeds in lists, with, when availagble a link to more
information.
+-------------------------------------------------------------------+
|  Feeds on YourSite.com                                            |
|  +-------------------------------+                                |
|  | Frontpage:                    |                                |
|  | * Headlines [xml][rdf]        |                                |
|  +-------------------------------+                                |
|  +-------------------------------+                                |
|  | Categories                    |                                |
|  | These are our specific        |                                | 
|  | categorised feeds             |                                |
|  | Main                          |                                |
|  | * News [xml][rdf]             |                                |
|  |   * Personal [xml][rdf]       |                                |
|  |   * Site [xml][rdf]           |                                |
|  | * Foo [xml][rdf]              |                                |
|  |                     read more |                                |
|  +-------------------------------+                                |
|  +-------------------------------+                                |
|  | Files:                        |                                |
|  | These are our feeds with files|                                |
|  | * Podcast [podcast]           |                                |
|  | * Images [xml]                |                                |
|  +-------------------------------+                                |
|  +-------------------------------+                                |
|  | Forums:                       |                                |
|  | * ChitChat [XML][rdf]         |                                |
|  |                     read more |                                |
|  +-------------------------------+                                |
|  +-------------------------------+                                |
|  | Aggregated                    |                                |
|  | These are the external feeds  |                                | 
|  | we aggregate                  |                                |
|  |                               |                                |
|  | * Feeds [xml][rdf]            |                                
|  |   * JohnDoe.com[xml][rdf]     |                                |
|  |   * Site.net [xml][rdf]       |                                |
|  | * Bubdles [xml][rdf]          |                                |
|  |                     read more |                                |
|  +-------------------------------+                                |
+-------------------------------------------------------------------+

Registering
-----------
With a hook similar to the menu hook we register a feed:
hook_feed($may_cache){
  $feeds[] = array(
               title='title'
	       listing='FALSE|title',
	       more='NULL|url/of/detailed/help/with/this/feed' 
	       entries = array(
	           icon='xml.png',
                   path='path/to/feed',
	           page='goes/with/url',
	           description='the description')
             )
  //example
  $feeds[] = array(
               title='Headlines'
	       listing='Frontpage',
	       entries = array(
	           icon='xml.png',
                   path='node/feed',
	           page='node',
	           description=$mission)
             )
             entries = array(
	           icon='xml-09.png',
                   path='node/feed/09',
	           page='node',
	           description='old feed')
             )

Bèr Kessels’s picture

Version: » 4.6.0

there is a modukle that does this.

Anonymous’s picture