You are here

aggregator-item.html.twig in Drupal 8

Default theme implementation to present a feed item in an aggregator page.

Available variables:

  • url: URL to the originating feed item.
  • title: (optional) Title of the feed item.
  • content: All field items. Use {{ content }} to print them all, or print a subset such as {{ content.field_example }}. Use {{ content|without('field_example') }} to temporarily suppress the printing of a given element.
  • attributes: HTML attributes for the wrapper.
  • title_prefix: Additional output populated by modules, intended to be displayed in front of the main title tag that appears in the template.
  • title_suffix: Additional output populated by modules, intended to be displayed after the main title tag that appears in the template.

File

core/modules/aggregator/templates/aggregator-item.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to present a feed item in an aggregator page.
  5. *
  6. * Available variables:
  7. * - url: URL to the originating feed item.
  8. * - title: (optional) Title of the feed item.
  9. * - content: All field items. Use {{ content }} to print them all,
  10. * or print a subset such as {{ content.field_example }}. Use
  11. * {{ content|without('field_example') }} to temporarily suppress the printing
  12. * of a given element.
  13. * - attributes: HTML attributes for the wrapper.
  14. * - title_prefix: Additional output populated by modules, intended to be
  15. * displayed in front of the main title tag that appears in the template.
  16. * - title_suffix: Additional output populated by modules, intended to be
  17. * displayed after the main title tag that appears in the template.
  18. *
  19. * @see template_preprocess_aggregator_item()
  20. *
  21. * @ingroup themeable
  22. */
  23. #}
  24. <article{{ attributes }}>
  25. {{ title_prefix }}
  26. {% if title %}
  27. <h3>
  28. <a href="{{ url }}">{{ title }}</a>
  29. </h3>
  30. {% endif %}
  31. {{ title_suffix }}
  32. {{ content }}
  33. </article>

Related topics