I've been working on updating the audio module's audio_itunes module to views2 and found most aspects of the RSS architecture very well thought out. One problem I ran into was being able to re-use the channel theming functions to add in additional channel level elements.

The attached patch adds a new function views_plugin_style_rss::get_channel_elements() to gather channel level elements together. When rendering this is called--the default returns an empty array--and the namespaces of the results are in with any added by the nodes.

When the time comes to render the feed, rather than using core's format_rss_channel() function and a the minimal views-view-rss.tpl.php to output it, I've moved format_rss_channel()'s logic into template_preprocess_views_view_rss() and views-view-rss.tpl.php where it can be easily re-used or extended.

For an example of how this can be used I've also attached some code from the audio_itunes.module that is called by it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drewish’s picture

As per #338641: Update audio_itunes for views2 the HEAD version of the audio_itunes.module has plug-in code that will use this.

drewish’s picture

FileSize
5.62 KB

This makes a correction to the way the namespaces are handled in views_plugin_row_node_rss to ensure that the dc namespace is added.

drewish’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.