{% macro menu(items, currentPath) %} {% import _self as self %} {% for menuItem in items %} {% set url = menuItem.url %} {% set attributes = "menuitem" %} {% if menuItem.classAttribute %} {% set attributes = attributes ~ ' ' ~ menuItem.classAttribute %} {% endif %} {% if menuItem.hasChild() %} {% set attributes = attributes ~ ' has-child dropdown' %} {% for childItem in menuItem.children %} {% set childUrl = childItem.url %} {% if childUrl == currentPath %} {% set attributes = attributes ~ ' active current-parent' %} {% endif %} {% endfor %} {% endif %} {% endfor %} {% endmacro %} {% macro menuchild(items, currentPath) %} {% import _self as self %} {% for menuItem in items %} {% set url = menuItem.url %} {{ menuItem.name }} {% endfor %} {% endmacro %}