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.
Comment | File | Size | Author |
---|---|---|---|
#2 | views_338632.patch | 5.62 KB | drewish |
audio_itunes_plugin_style_rss.inc_.txt | 6.93 KB | drewish | |
views_rss_template.patch | 4.11 KB | drewish | |
Comments
Comment #1
drewish CreditAttribution: drewish commentedAs per #338641: Update audio_itunes for views2 the HEAD version of the audio_itunes.module has plug-in code that will use this.
Comment #2
drewish CreditAttribution: drewish commentedThis makes a correction to the way the namespaces are handled in views_plugin_row_node_rss to ensure that the dc namespace is added.
Comment #3
drewish CreditAttribution: drewish commentedlooks like this got committed.
http://drupal.org/cvs?commit=156171
http://drupal.org/cvs?commit=156172