You are here

menu--extras.html.twig in Menu Item Extras 8.2

Theme override to display a menu.

Available variables:

  • menu_name: The machine name of the menu.
  • items: A nested list of menu items. Each menu item contains:
    • attributes: HTML attributes for the menu item.
    • content.children: The menu item child items.
    • title: The menu link title.
    • url: The menu link url, instance of \Drupal\Core\Url
    • content: The field item content.
    • 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.

File

templates/menu--extras.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override to display a menu.
  5. *
  6. * Available variables:
  7. * - menu_name: The machine name of the menu.
  8. * - items: A nested list of menu items. Each menu item contains:
  9. * - attributes: HTML attributes for the menu item.
  10. * - content.children: The menu item child items.
  11. * - title: The menu link title.
  12. * - url: The menu link url, instance of \Drupal\Core\Url
  13. * - content: The field item content.
  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. #}
  22. {% import "menu-levels.html.twig" as menu %}
  23. {{ menu.menu_links(items, attributes, 0) }}