From e7724c1d837f2ac974bbeb01cc6b13d69d281a5e Mon Sep 17 00:00:00 2001
From: ebremner <ebremner@uwaterloo.ca>
Date: Mon, 30 Nov 2020 11:12:37 -0500
Subject: [PATCH] ISTWCMS-4199: updating menu structure to allow for parenting
 to be displayed correctly

---
 source/_patterns/04-components/menu/menu.twig | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/source/_patterns/04-components/menu/menu.twig b/source/_patterns/04-components/menu/menu.twig
index 4dc2cb9f..9fec32e6 100644
--- a/source/_patterns/04-components/menu/menu.twig
+++ b/source/_patterns/04-components/menu/menu.twig
@@ -4,6 +4,7 @@
 
 {% macro menu_links(items, attributes, menu_level, menu_name, menu_class, item_class, link_class, parent) %}
   {% import _self as menus %}
+
   {% if items %}
 
     {% if menu_level == 0 %}
@@ -89,7 +90,7 @@
 
 
 
-      {% if menu_level == 1 and parent and not menu_parent_hide  %}
+      {% if menu_level == 1 and parent %}
 
         <li {{ add_attributes(additional_item_attributes) }}>
 
@@ -103,18 +104,22 @@
             </span>
           </a>
         </li>
-        {% endif %}
-
-      <li {{ add_attributes(additional_item_attributes) }}>
 
+      {% endif %}
 
+      <li {{ add_attributes(additional_item_attributes) }}>
         <a
-          {% if item.submenu %}
+          {% if item.submenu and menu_level == 0 %}
+            tabindex="0"
+            aria-haspopup="true"
+            role="button"
+          {% elseif item.submenu %}
             tabindex="0"
             aria-haspopup="true"
             role="button"
+            href="{{ item.url }}"
           {% else %}
-           href="{{ item.url }}"
+            href="{{ item.url }}"
           {% endif %}
           {{ add_attributes(link_attributes) }}
         >
-- 
GitLab