From 7c335eb7052aceca31b9a9ac3b989a1639697625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Fri, 24 Aug 2018 09:50:24 -0400 Subject: [PATCH] Add class to the link items --- agaric/templates/navigation/menu.html.twig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/agaric/templates/navigation/menu.html.twig b/agaric/templates/navigation/menu.html.twig index 523fd8a..249a4a7 100644 --- a/agaric/templates/navigation/menu.html.twig +++ b/agaric/templates/navigation/menu.html.twig @@ -31,8 +31,9 @@ https://gitlab.com/agaric/sites/agaric-com/issues/77 #} {{ menus.menu_links(items, attributes, 0, menu_name) }} -{% set submenu_attributes = create_attribute() %} {% macro menu_links(items, attributes, menu_level, menu_name) %} + {% set submenu_attributes = create_attribute() %} + {% set link_attributes = create_attribute().addClass('navbar-item') %} {% import _self as menus %} {% set submenu_classes = [ 'navbar-item', @@ -44,7 +45,7 @@ {% endif %} {% for item in items %} - {{ link(item.title, item.url) }} + {{ link(item.title, item.url, link_attributes) }} {% if item.below %} {{ menus.menu_links(item.below, attributes, menu_level + 1) }} {% endif %}