toolbar.twig

Default template for admin toolbar.

Available variables:

  • tabs: Themed links for the top level tabs.
  • trays: An array of trays. It contains:
    • content: The themed tray content.
    • attributes: HTML attributes for the surrounding element. It includes:
      • id: The unique id of the tray. This corresponds to the module name registered the tray.
      • class: A list of classes to target the trays for styling.
  • attributes: HTML attributes for the surrounding element. It includes:
    • id: The unique id of the toolbar.
    • class: A list of classes to target the toolbar for styling.

See also

template_preprocess()

template_preprocess_toolbar()

File

drupal/core/modules/toolbar/templates/toolbar.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default template for admin toolbar.
  5. *
  6. * Available variables:
  7. *
  8. * - tabs: Themed links for the top level tabs.
  9. * - trays: An array of trays. It contains:
  10. * - content: The themed tray content.
  11. * - attributes: HTML attributes for the surrounding element. It includes:
  12. * - id: The unique id of the tray. This corresponds to the module name
  13. * registered the tray.
  14. * - class: A list of classes to target the trays for styling.
  15. * - attributes: HTML attributes for the surrounding element. It includes:
  16. * - id: The unique id of the toolbar.
  17. * - class: A list of classes to target the toolbar for styling.
  18. *
  19. * @see template_preprocess()
  20. * @see template_preprocess_toolbar()
  21. *
  22. * @ingroup themeable
  23. */
  24. #}
  25. <nav id="{{ attributes.id }}" class="{{ attributes.class }}"{{ attributes }}>
  26. <!-- Tabs -->
  27. {{ tabs }}
  28. <!-- Trays -->
  29. {% for tray in trays %}
  30. <div id="{{ tray.attributes.id }}" class="{{ tray.attributes.class }}"{{ tray.attributes }}>
  31. <div class="lining clearfix">
  32. <h3 class="element-invisible">{{ tray.heading }}</h3>
  33. {{ tray.content }}
  34. </div>
  35. </div>
  36. {% endfor %}
  37. </nav>

Related topics