toolbar.html.twig

Same filename in this branch
  1. main core/profiles/demo_umami/themes/umami/templates/classy/navigation/toolbar.html.twig
  2. main core/themes/stable9/templates/navigation/toolbar.html.twig
  3. main core/themes/claro/templates/navigation/toolbar.html.twig
  4. main core/themes/claro/templates/classy/navigation/toolbar.html.twig
  5. main core/modules/toolbar/templates/toolbar.html.twig
  6. main core/themes/admin/templates/navigation/toolbar.html.twig
Same filename and directory in other branches
  1. 10 core/profiles/demo_umami/themes/umami/templates/classy/navigation/toolbar.html.twig
  2. 10 core/themes/stable9/templates/navigation/toolbar.html.twig
  3. 10 core/themes/claro/templates/navigation/toolbar.html.twig
  4. 10 core/themes/claro/templates/classy/navigation/toolbar.html.twig
  5. 11.x core/profiles/demo_umami/themes/umami/templates/classy/navigation/toolbar.html.twig
  6. 11.x core/themes/stable9/templates/navigation/toolbar.html.twig
  7. 11.x core/themes/claro/templates/navigation/toolbar.html.twig
  8. 11.x core/themes/claro/templates/classy/navigation/toolbar.html.twig
  9. 11.x core/modules/toolbar/templates/toolbar.html.twig
  10. 10 core/modules/toolbar/templates/toolbar.html.twig
  11. 9 core/profiles/demo_umami/themes/umami/templates/classy/navigation/toolbar.html.twig
  12. 9 core/themes/stable9/templates/navigation/toolbar.html.twig
  13. 9 core/themes/seven/templates/classy/navigation/toolbar.html.twig
  14. 9 core/themes/claro/templates/navigation/toolbar.html.twig
  15. 9 core/themes/claro/templates/classy/navigation/toolbar.html.twig
  16. 9 core/themes/bartik/templates/classy/navigation/toolbar.html.twig
  17. 9 core/themes/stable/templates/navigation/toolbar.html.twig
  18. 9 core/themes/classy/templates/navigation/toolbar.html.twig
  19. 9 core/modules/toolbar/templates/toolbar.html.twig
  20. 8.9.x core/profiles/demo_umami/themes/umami/templates/classy/navigation/toolbar.html.twig
  21. 8.9.x core/themes/seven/templates/classy/navigation/toolbar.html.twig
  22. 8.9.x core/themes/claro/templates/classy/navigation/toolbar.html.twig
  23. 8.9.x core/themes/bartik/templates/classy/navigation/toolbar.html.twig
  24. 8.9.x core/themes/stable/templates/navigation/toolbar.html.twig
  25. 8.9.x core/themes/classy/templates/navigation/toolbar.html.twig
  26. 8.9.x core/modules/toolbar/templates/toolbar.html.twig
  27. 11.x core/themes/admin/templates/navigation/toolbar.html.twig
  28. 11.x core/themes/admin/templates/classy/navigation/toolbar.html.twig

Theme override 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/themes/admin/templates/classy/navigation/toolbar.html.twig

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

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