{% macro section(item, currentRoute) %} {% set routePrefix = currentRoute|split('_')|slice(0, -1)|join('_') %} {% if currentRoute matches '/admin_parameter_value/' or currentRoute matches '/admin_variant_value/' or currentRoute matches '/admin_template_set/' or currentRoute matches '/admin_template_share_content/' %} {% set routePrefix = currentRoute|split('_')|slice(0, -2)|join('_') %} {% endif %} {% set isMenuOpen = false %} {% for subMenuItem in item.dto.subMenuItems %} {% if routePrefix != 'admin' and subMenuItem.dto.route starts with routePrefix %} {% if not (routePrefix == 'admin_order' and subMenuItem.dto.route matches '/admin_order_state/') %} {% set isMenuOpen = true %} {% endif %} {% endif %} {% endfor %} {# {{ dump(routePrefix, currentRoute) }}#} {% endmacro %} {% macro crud_link(item, currentRoute, routePrefix) %} {% set isActive = routePrefix != 'admin' and item.dto.route starts with routePrefix %} {% if currentRoute == 'admin_order_index' and item.dto.route == 'admin_order_state_index' %} {% set isActive = false %} {% endif %} {% endmacro %}