You are here

menu-local-tasks.html.twig in Drupal 9

Default theme implementation to display primary and secondary local tasks.

Available variables:

  • primary: HTML list items representing primary tasks.
  • secondary: HTML list items representing secondary tasks.

Each item in these variables (primary and secondary) can be individually themed in menu-local-task.html.twig.

File

core/modules/system/templates/menu-local-tasks.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display primary and secondary local tasks.
  5. *
  6. * Available variables:
  7. * - primary: HTML list items representing primary tasks.
  8. * - secondary: HTML list items representing secondary tasks.
  9. *
  10. * Each item in these variables (primary and secondary) can be individually
  11. * themed in menu-local-task.html.twig.
  12. *
  13. * @ingroup themeable
  14. */
  15. #}
  16. {% if primary %}
  17. <h2 class="visually-hidden">{{ 'Primary tabs'|t }}</h2>
  18. <ul>{{ primary }}</ul>
  19. {% endif %}
  20. {% if secondary %}
  21. <h2 class="visually-hidden">{{ 'Secondary tabs'|t }}</h2>
  22. <ul>{{ secondary }}</ul>
  23. {% endif %}

Related topics