menu-region--footer.html.twig

Same filename 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.
  • 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. * - title: A name of account.
  9. * - items: A nested list of menu items. Each menu item contains:
  10. * - attributes: HTML attributes for the menu item.
  11. * - below: The menu item child items.
  12. * - title: The menu link title.
  13. * - url: The menu link URL, instance of \Drupal\Core\Url
  14. * - localized_options: Menu link localized options.
  15. * - is_expanded: TRUE if the link has visible children within the current
  16. * menu tree.
  17. * - is_collapsed: TRUE if the link has children within the current menu tree
  18. * that are not currently visible.
  19. * - in_active_trail: TRUE if the link is in the active trail.
  20. *
  21. * @ingroup themeable
  22. */
  23. #}
  24. <div class="admin-toolbar__item">
  25. {# @todo id & aria-labelledby will be brought back via JS in https://www.drupal.org/project/drupal/issues/3452724 #}
  26. <h4 class="visually-hidden focusable">{{ title }}</h4>
  27. <ul class="toolbar-block__list">
  28. <li id="admin-toolbar-user-menu" class="toolbar-block__list-item toolbar-block__list-item--user toolbar-popover" data-toolbar-popover>
  29. {% include 'navigation:toolbar-button' with {
  30. action: 'Extend'|t,
  31. attributes: create_attribute({
  32. 'aria-expanded': 'false',
  33. 'aria-controls': 'admin-toolbar-user-menu',
  34. 'data-toolbar-popover-control': true,
  35. 'data-has-safe-triangle': true,
  36. }),
  37. icon: menu_name|clean_class,
  38. text: title,
  39. modifiers: [
  40. 'expand--side',
  41. 'collapsible',
  42. ],
  43. extra_classes: [
  44. 'toolbar-popover__control',
  45. ],
  46. } only %}
  47. <div class="toolbar-popover__wrapper" data-toolbar-popover-wrapper>
  48. {% include 'navigation:toolbar-button' with {
  49. attributes: create_attribute(),
  50. modifiers: [
  51. 'large',
  52. 'dark',
  53. 'non-interactive',
  54. ],
  55. extra_classes: [
  56. 'toolbar-popover__header',
  57. ],
  58. html_tag: 'span',
  59. text: title,
  60. } only %}
  61. <ul class="toolbar-menu toolbar-popover__menu">
  62. {% for item in items %}
  63. <li class="toolbar-menu__item toolbar-menu__item--level-1">
  64. {% include 'navigation:toolbar-button' with {
  65. attributes: create_attribute({ 'href': item.url|render }),
  66. html_tag: 'a',
  67. text: item.title,
  68. } only %}
  69. </li>
  70. {% endfor %}
  71. </ul>
  72. </div>
  73. </li>
  74. </ul>
  75. </div>

Related topics


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