top-bar.html.twig

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

Default theme implementation for the navigation top bar.

Available variables:

  • local_tasks: The local tasks for the current route.
1 theme call to top-bar.html.twig
NavigationRenderer::buildTopBar in core/modules/navigation/src/NavigationRenderer.php
Build the top bar for content entity pages.

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. * - local_tasks: The local tasks for the current route.
  8. *
  9. * @ingroup themeable
  10. */
  11. #}
  12. {% set attributes = create_attribute() %}
  13. {% if local_tasks %}
  14. {% set attributes = attributes.setAttribute('data-offset-top', '') %}
  15. <div {{ attributes.addClass('top-bar').setAttribute('data-drupal-admin-styles', '') }}>
  16. <div class="top-bar__content">
  17. {{ local_tasks }}
  18. </div>
  19. </div>
  20. {% endif %}

Related topics


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