aggregator-item.html.twig

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

Available variables:

  • feed_url: URL to the originating feed item.
  • feed_title: Title of the feed item.
  • source_url: Link to the local source section.
  • source_title: Title of the remote source.
  • source_date: Date the feed was posted on the remote source.
  • content: Feed item content.
  • categories: Linked categories assigned to the feed.

See also

template_preprocess()

template_preprocess_aggregator_item()

File

drupal/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. * - feed_url: URL to the originating feed item.
  8. * - feed_title: Title of the feed item.
  9. * - source_url: Link to the local source section.
  10. * - source_title: Title of the remote source.
  11. * - source_date: Date the feed was posted on the remote source.
  12. * - content: Feed item content.
  13. * - categories: Linked categories assigned to the feed.
  14. *
  15. * @see template_preprocess()
  16. * @see template_preprocess_aggregator_item()
  17. *
  18. * @ingroup themeable
  19. */
  20. #}
  21. <div{{ attributes }}>
  22. <h3 class="feed-item-title">
  23. <a href="{{ feed_url }}">{{ feed_title }}</a>
  24. </h3>
  25. <div class="feed-item-meta">
  26. {% if source_url %}
  27. <a href="{{ source_url }}" class="feed-item-source">{{ source_title }}</a> -
  28. {% endif %}
  29. <span class="feed-item-date">{{ source_date }}</span>
  30. </div>
  31. {% if content %}
  32. <div class="feed-item-body">
  33. {{ content }}
  34. </div>
  35. {% endif %}
  36. {% if categories %}
  37. <div class="feed-item-categories">
  38. {{ 'Categories'|t }}: {{ categories|join(', ') }}
  39. </div>
  40. {% endif %}
  41. </div>

Related topics