menu-region--footer.html.twig

Same filename in other branches
  1. 11.x 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. {% set menu_heading_id = 'menu--' ~ menu_name|clean_unique_id %}
  26. <div class="admin-toolbar__item">
  27. <h4 id="{{ menu_heading_id }}" class="toolbar-block__title 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' 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. modifiers: ['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' with {
  42. action: 'Extend'|t,
  43. attributes: create_attribute({
  44. 'aria-expanded': 'false',
  45. 'aria-controls': 'admin-toolbar-user-menu',
  46. 'data-toolbar-popover-control': true,
  47. 'data-has-safe-triangle': true,
  48. }),
  49. icon: menu_name|clean_class,
  50. text: title,
  51. modifiers: [
  52. 'expand--side',
  53. 'collapsible',
  54. ],
  55. extra_classes: [
  56. 'toolbar-popover__control',
  57. ],
  58. } only %}
  59. <div class="toolbar-popover__wrapper" data-toolbar-popover-wrapper>
  60. {% include 'navigation:toolbar-button' with {
  61. attributes: create_attribute(),
  62. modifiers: [
  63. 'large',
  64. 'dark',
  65. 'non-interactive',
  66. ],
  67. extra_classes: [
  68. 'toolbar-popover__header',
  69. ],
  70. html_tag: 'span',
  71. text: title,
  72. } only %}
  73. <ul class="toolbar-menu toolbar-popover__menu">
  74. {% for item in items %}
  75. <li class="toolbar-menu__item toolbar-menu__item--level-1">
  76. {% include 'navigation:toolbar-button' with {
  77. attributes: create_attribute({ 'href': item.url|render }),
  78. html_tag: 'a',
  79. text: item.title,
  80. } only %}
  81. </li>
  82. {% endfor %}
  83. </ul>
  84. </div>
  85. </li>
  86. </ul>
  87. </div>

Related topics


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