You are here

sitemap.html.twig in Sitemap 8

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

Theme implementation to display the sitemap.

Available variables:

  • message: A configurable introductory message.
  • sitemap_items: A keyed array of sitemap "boxes". The keys correspond to the available types of sitemap content, including:

    • front
    • books
    • individual menus
    • individual vocabularies

    Each items contains the following variables:

    • title: The subject of the box.
    • content: The content of the box.
    • attributes: Optional attributes for the box.
    • options: Options are set by sitemap.helper service.
  • additional:

File

templates/sitemap.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme implementation to display the sitemap.
  5. *
  6. * Available variables:
  7. * - message: A configurable introductory message.
  8. * - sitemap_items: A keyed array of sitemap "boxes".
  9. * The keys correspond to the available types of sitemap content, including:
  10. * - front
  11. * - books
  12. * - individual menus
  13. * - individual vocabularies
  14. * Each items contains the following variables:
  15. * - title: The subject of the box.
  16. * - content: The content of the box.
  17. * - attributes: Optional attributes for the box.
  18. * - options: Options are set by sitemap.helper service.
  19. * - additional:
  20. *
  21. * @see template_preprocess()
  22. * @see template_preprocess_sitemap()
  23. */
  24. #}
  25. <div class="sitemap">
  26. {% if message %}
  27. <div class="sitemap-message">
  28. {{ message }}
  29. </div>
  30. {% endif %}
  31. {% if sitemap_items %}
  32. {% for item in sitemap_items %}
  33. {% if item.content is not empty %}
  34. <div{{ item.attributes.addClass('sitemap-box') }}>
  35. {% if item.options.show_titles %}
  36. <h2>{{ item.title }}</h2>
  37. {% endif %}
  38. <div class="content">
  39. {{ item.content }}
  40. </div>
  41. </div>
  42. {% endif %}
  43. {% endfor %}
  44. {% endif %}
  45. {% if additional %}
  46. <div class="sitemap-additional">
  47. {{ additional }}
  48. </div>
  49. {% endif %}
  50. </div>