You are here

sitemap-item.html.twig in Sitemap 8.2

Same filename and directory in other branches
  1. 2.0.x templates/sitemap-item.html.twig

Theme implementation to display a single Sitemap plugin item.

Available variables:

  • title: The title of the sitemap item if configured.
  • content: A renderable array of sitemap item content.
  • sitemap: The full sitemap plugin instance.
  • attributes: Attributes for the sitemap item container.
  • plugin_type: The plugin definition ID.
  • plugin_id: The specific plugin ID.

File

templates/sitemap-item.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme implementation to display a single Sitemap plugin item.
  5. *
  6. * Available variables:
  7. * - title: The title of the sitemap item if configured.
  8. * - content: A renderable array of sitemap item content.
  9. * - sitemap: The full sitemap plugin instance.
  10. * - attributes: Attributes for the sitemap item container.
  11. * - plugin_type: The plugin definition ID.
  12. * - plugin_id: The specific plugin ID.
  13. **/
  14. #}
  15. {%
  16. set classes = [
  17. 'sitemap-item',
  18. plugin_type ? 'sitemap-plugin--' ~ plugin_type|clean_class,
  19. plugin_id ? 'sitemap-item--' ~ plugin_id|clean_class,
  20. ]
  21. %}
  22. {% if content %}
  23. <div{{ attributes.addClass(classes) }}>
  24. {% if title %}
  25. <h2>{{ title }}</h2>
  26. {% endif %}
  27. <div>
  28. {{ content }}
  29. </div>
  30. </div>
  31. {% endif %}