top-bar.html.twig

Same filename and directory in other branches
  1. 10 core/modules/navigation/templates/top-bar.html.twig

Default theme implementation for the navigation top bar.

Available variables:

  • element: The top bar render element.
  • tools: The tools region of the top bar.
  • context: The context region of the top bar.
  • actions: The actions region of the top bar.
1 theme call to top-bar.html.twig
TopBar::getInfo in core/modules/navigation/src/Element/TopBar.php
Returns the element properties for this element.

File

core/modules/navigation/templates/top-bar.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for the navigation top bar.
  5. *
  6. * Available variables:
  7. * - element: The top bar render element.
  8. * - tools: The tools region of the top bar.
  9. * - context: The context region of the top bar.
  10. * - actions: The actions region of the top bar.
  11. *
  12. * @ingroup themeable
  13. */
  14. #}
  15. {% set attributes = create_attribute() %}
  16. {% if tools or context|render or actions|render %}
  17. <aside {{ attributes.addClass('top-bar').setAttribute('data-drupal-admin-styles', '').setAttribute('aria-labelledby', 'top-bar__title').setAttribute('data-offset-top', true) }}>
  18. <h3 id="top-bar__title" class="visually-hidden">{{ 'Administrative top bar'|t }}</h3>
  19. <div class="top-bar__content">
  20. <div class="top-bar__tools">
  21. {{- tools -}}
  22. </div>
  23. <div class="top-bar__context">
  24. {{- context -}}
  25. </div>
  26. <div class="top-bar__actions">
  27. {{- actions -}}
  28. </div>
  29. </div>
  30. </aside>
  31. {% endif %}

Related topics


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