Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Maybe I'm missing something, but it appears you can only map fields to standard RSS tags. I want to additionally include fields as custom XML. It looks like the only way to do that is in the template, correct?
Comments
Comment #1
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commentedYou can map fields to any elements defined by any module providing feed fields. If you want to include RSS elements which are not provided by any of the Views RSS family modules, you would need to define them yourself in one of your modules, implementing
hook_views_rss_channel_elements()
for <channel> elements andhook_views_rss_item_elements()
for <item> elements (and optionallyhook_views_rss_namespaces()
for namespaces) (see Hooks documentation page for list of all hooks provided by the module). I haven't got to writing a detailed documentation on these hooks yet, but have a look into one of the existing modules to see how to do it (and don't forget to clear Views cache after each change, as the definitions are being cached).