toolbar.html.twig

Same filename in this branch
  1. 8.9.x core/profiles/demo_umami/themes/umami/templates/classy/navigation/toolbar.html.twig
  2. 8.9.x core/themes/seven/templates/classy/navigation/toolbar.html.twig
  3. 8.9.x core/themes/claro/templates/classy/navigation/toolbar.html.twig
  4. 8.9.x core/themes/bartik/templates/classy/navigation/toolbar.html.twig
  5. 8.9.x core/themes/stable/templates/navigation/toolbar.html.twig
  6. 8.9.x core/themes/classy/templates/navigation/toolbar.html.twig
Same filename in other branches
  1. 9 core/profiles/demo_umami/themes/umami/templates/classy/navigation/toolbar.html.twig
  2. 9 core/themes/stable9/templates/navigation/toolbar.html.twig
  3. 9 core/themes/seven/templates/classy/navigation/toolbar.html.twig
  4. 9 core/themes/claro/templates/navigation/toolbar.html.twig
  5. 9 core/themes/claro/templates/classy/navigation/toolbar.html.twig
  6. 9 core/themes/bartik/templates/classy/navigation/toolbar.html.twig
  7. 9 core/themes/stable/templates/navigation/toolbar.html.twig
  8. 9 core/themes/classy/templates/navigation/toolbar.html.twig
  9. 9 core/modules/toolbar/templates/toolbar.html.twig
  10. 10 core/profiles/demo_umami/themes/umami/templates/classy/navigation/toolbar.html.twig
  11. 10 core/themes/stable9/templates/navigation/toolbar.html.twig
  12. 10 core/themes/claro/templates/navigation/toolbar.html.twig
  13. 10 core/themes/claro/templates/classy/navigation/toolbar.html.twig
  14. 10 core/modules/toolbar/templates/toolbar.html.twig
  15. 11.x core/profiles/demo_umami/themes/umami/templates/classy/navigation/toolbar.html.twig
  16. 11.x core/themes/stable9/templates/navigation/toolbar.html.twig
  17. 11.x core/themes/claro/templates/navigation/toolbar.html.twig
  18. 11.x core/themes/claro/templates/classy/navigation/toolbar.html.twig
  19. 11.x core/modules/toolbar/templates/toolbar.html.twig

Default theme implementation for the administrative toolbar.

Available variables:

  • attributes: HTML attributes for the wrapper.
  • toolbar_attributes: HTML attributes to apply to the toolbar.
  • toolbar_heading: The heading or label for the toolbar.
  • tabs: List of tabs for the toolbar.
    • attributes: HTML attributes for the tab container.
    • link: Link or button for the menu tab.
  • trays: Toolbar tray list, each associated with a tab. Each tray in trays contains:

    • attributes: HTML attributes to apply to the tray.
    • label: The tray's label.
    • links: The tray menu links.
  • remainder: Any non-tray, non-tab elements left to be rendered.

See also

template_preprocess_toolbar()

1 theme call to toolbar.html.twig
Toolbar::getInfo in core/modules/toolbar/src/Element/Toolbar.php
Returns the element properties for this element.

File

core/modules/toolbar/templates/toolbar.html.twig

View source
  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>

Related topics


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.