toolbar.html.twig 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for the administrative toolbar.
  5. *
  6. * Available variables:
  7. * - attributes: HTML attributes for the wrapper.
  8. * - toolbar_attributes: HTML attributes to apply to the toolbar.
  9. * - toolbar_heading: The heading or label for the toolbar.
  10. * - tabs: List of tabs for the toolbar.
  11. * - attributes: HTML attributes for the tab container.
  12. * - link: Link or button for the menu tab.
  13. * - trays: Toolbar tray list, each associated with a tab. Each tray in trays
  14. * contains:
  15. * - attributes: HTML attributes to apply to the tray.
  16. * - label: The tray's label.
  17. * - links: The tray menu links.
  18. * - remainder: Any non-tray, non-tab elements left to be rendered.
  19. *
  20. * @see template_preprocess_toolbar()
  21. *
  22. * @ingroup themeable
  23. */
  24. #}
  25. <div{{ attributes.addClass('toolbar') }}>
  26. <nav{{ toolbar_attributes.addClass('toolbar-bar') }}>
  27. <h2 class="visually-hidden">{{ toolbar_heading }}</h2>
  28. {% for key, tab in tabs %}
  29. {% set tray = trays[key] %}
  30. <div{{ tab.attributes.addClass('toolbar-tab') }}>
  31. {{ tab.link }}
  32. {% spaceless %}
  33. <div{{ tray.attributes }}>
  34. {% if tray.label %}
  35. <nav class="toolbar-lining clearfix" role="navigation" aria-label="{{ tray.label }}">
  36. <h3 class="toolbar-tray-name visually-hidden">{{ tray.label }}</h3>
  37. {% else %}
  38. <nav class="toolbar-lining clearfix" role="navigation">
  39. {% endif %}
  40. {{ tray.links }}
  41. </nav>
  42. </div>
  43. {% endspaceless %}
  44. </div>
  45. {% endfor %}
  46. </nav>
  47. {{ remainder }}
  48. </div>