menu-region--footer.html.twig

Same filename and directory in other branches
  1. 10 core/modules/navigation/templates/menu-region--footer.html.twig

Default theme implementation to display the navigation footer menu.

Available variables:

  • menu_name: The machine name of the user menu.
  • help: TRUE if "Help" module is enabled.
  • title: A name of account.
  • items: A nested list of menu items. Each menu item contains:
    • attributes: HTML attributes for the menu item.
    • below: The menu item child items.
    • title: The menu link title.
    • url: The menu link URL, instance of \Drupal\Core\Url
    • localized_options: Menu link localized options.
    • is_expanded: TRUE if the link has visible children within the current menu tree.
    • is_collapsed: TRUE if the link has children within the current menu tree that are not currently visible.
    • in_active_trail: TRUE if the link is in the active trail.
1 theme call to menu-region--footer.html.twig
UserLazyBuilder::renderNavigationLinks in core/modules/navigation/src/UserLazyBuilder.php
Lazy builder callback for rendering navigation links.

File

core/modules/navigation/templates/menu-region--footer.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display the navigation footer menu.
  5. *
  6. * Available variables:
  7. * - menu_name: The machine name of the user menu.
  8. * - help: TRUE if "Help" module is enabled.
  9. * - title: A name of account.
  10. * - items: A nested list of menu items. Each menu item contains:
  11. * - attributes: HTML attributes for the menu item.
  12. * - below: The menu item child items.
  13. * - title: The menu link title.
  14. * - url: The menu link URL, instance of \Drupal\Core\Url
  15. * - localized_options: Menu link localized options.
  16. * - is_expanded: TRUE if the link has visible children within the current
  17. * menu tree.
  18. * - is_collapsed: TRUE if the link has children within the current menu tree
  19. * that are not currently visible.
  20. * - in_active_trail: TRUE if the link is in the active trail.
  21. *
  22. * @ingroup themeable
  23. */
  24. #}
  25. <div class="admin-toolbar__item">
  26. {# @todo id & aria-labelledby will be brought back via JS in https://www.drupal.org/project/drupal/issues/3452724 #}
  27. <h4 class="visually-hidden focusable">{{ title }}</h4>
  28. <ul class="toolbar-block__list">
  29. {% if help %}
  30. <li class="toolbar-block__list-item">
  31. {% include '@navigation/toolbar-button.html.twig' with {
  32. attributes: create_attribute({ 'href': path('help.main'), 'data-drupal-tooltip': 'Help'|t, 'data-drupal-tooltip-class': 'admin-toolbar__tooltip' }),
  33. icon: 'help',
  34. html_tag: 'a',
  35. text: 'Help'|t,
  36. extra_classes: 'toolbar-button--collapsible',
  37. } only %}
  38. </li>
  39. {% endif %}
  40. <li id="admin-toolbar-user-menu" class="toolbar-block__list-item toolbar-block__list-item--user toolbar-popover" data-toolbar-popover>
  41. {% include '@navigation/toolbar-button.html.twig' with {
  42. action: true,
  43. attributes: create_attribute({'aria-expanded': 'false', 'aria-controls': 'admin-toolbar-user-menu', 'data-toolbar-popover-control': true}),
  44. icon: menu_name|clean_class,
  45. text: title,
  46. extra_classes: 'toolbar-button--expand--side toolbar-button--collapsible toolbar-popover__control',
  47. has_safe_triangle: TRUE,
  48. } only %}
  49. <div class="toolbar-popover__wrapper" data-toolbar-popover-wrapper>
  50. <span class="toolbar-popover__header toolbar-button toolbar-button--large toolbar-button--dark toolbar-button--non-interactive">{{ title }}</span>
  51. <ul class="toolbar-menu toolbar-popover__menu">
  52. {% for item in items %}
  53. <li class="toolbar-menu__item toolbar-menu__item--level-1">
  54. <a
  55. href="{{ item.url }}"
  56. class="toolbar-button"
  57. >{{ item.title }}</a>
  58. </li>
  59. {% endfor %}
  60. </ul>
  61. </div>
  62. </li>
  63. </ul>
  64. </div>

Related topics


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