You are here

views-view-rss-podcast-feed.html.twig in Podcast (using Views) 8

Default template for feed displays that use the RSS style.

Available variables:

  • link: The link to the feed (the view path).
  • namespaces: The XML namespaces (added automatically).
  • title: The title of the feed (as set in the view).
  • description: The feed description (from feed settings).
  • langcode: The language encoding.
  • channel_elements: The formatted channel elements.
  • items: The feed items themselves.

File

templates/views-view-rss-podcast-feed.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default template for feed displays that use the RSS style.
  5. *
  6. * Available variables:
  7. * - link: The link to the feed (the view path).
  8. * - namespaces: The XML namespaces (added automatically).
  9. * - title: The title of the feed (as set in the view).
  10. * - description: The feed description (from feed settings).
  11. * - langcode: The language encoding.
  12. * - channel_elements: The formatted channel elements.
  13. * - items: The feed items themselves.
  14. *
  15. * @see template_preprocess_views_view_rss()
  16. *
  17. * @ingroup themeable
  18. */
  19. #}
  20. {% apply spaceless %}
  21. <?xml version="1.0" encoding="utf-8" ?>
  22. <rss version="2.0" xml:base="{{ link }}"{{ namespaces }}>
  23. <channel>
  24. <language>{{ langcode }}</language>
  25. {% for item in podcast_elements -%}
  26. <{{ item.key }}{{ item.attributes -}}
  27. {% if item.value -%}
  28. >{{ item.value }}</{{ item.key }}>
  29. {% else -%}
  30. {{ ' />' }}
  31. {% endif %}
  32. {%- endfor %}
  33. {{ items }}
  34. </channel>
  35. </rss>
  36. {% endapply %}