{% apply spaceless %} {# Parameters: - "item" (object) - "is_current" (boolean) Whether the item is currently selected - "label" (string) Label of the menu link - "icon_path" (string) Path to the icon sprite - "trigger_aria_label" (string) Aria label for the trigger button, - "children" (array of object) Array of sub-items - "external": (boolean) External link - "is_current" (boolean) Whether the sub-item is currently selected - "path" (string) Href of the sub-item link - "label" (string) Label of the sub-item link #} {% set _item = item|default({}) %} {% set _menu_item_class = 'ecl-menu__link' %} {% set _menu_item_attributes = 'data-ecl-menu-link' %} {% set _menu_list_item_attributes = 'data-ecl-menu-item' %} {% set _menu_list_item_class = 'ecl-menu__item' %} {% set _icon_path = icon_path|default('') %} {% set _external = external|default(false) %} {% if _item.is_current is defined %} {% set _menu_item_class = _menu_item_class ~ ' ecl-menu__link--current' %} {% set _menu_list_item_class = _menu_list_item_class ~ ' ecl-menu__item--current' %} {% endif %} {% if item.children is defined and item.children is not empty and item.children is iterable %} {% set _menu_list_item_attributes = _menu_list_item_attributes ~ ' data-ecl-has-children aria-haspopup aria-expanded="false"' %} {% set _menu_list_item_class = _menu_list_item_class ~ ' ecl-menu__item--has-children' %} {% endif %}