You are here

menu--group-menu.html.twig in Group Content Menu 8

Default theme implementation to display a menu.

Available variables:

  • classes: A list of classes to apply to the top level <ul> element.
  • dropdown_classes: A list of classes to apply to the dropdown <ul> element.
  • 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.
    • 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.

File

templates/menu--group-menu.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a menu.
  5. *
  6. * Available variables:
  7. * - classes: A list of classes to apply to the top level <ul> element.
  8. * - dropdown_classes: A list of classes to apply to the dropdown <ul> element.
  9. * - menu_name: The machine name of the menu.
  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. *
  17. * @ingroup templates
  18. */
  19. #}
  20. {# Works well in a Bootstrap based theme. Other themes it might not be as pretty. #}
  21. {% extends "menu.html.twig" %}
  22. {%
  23. set classes = [
  24. 'menu',
  25. 'group-menu',
  26. 'nav',
  27. 'navbar-nav',
  28. ]
  29. %}