{# we start with level 2, level 1 is never used: Einstiegskategorie #}
{# navigation has 3 levels max (2-4) #}
{# choose correct layout according to active result level #}
{% block layout_navigation_categories %}
{% block layout_navigation_categories_list %}
{% if activeResult.level == 2 %}
{% for item in navigationTree %}
{# found in second level: render level two template #}
{% if item.category.id == activeResult.id %}
{% set levelFound = true %}
{% sw_include '@Storefront/solution360/layout/sidebar/level-two-category-navigation.html.twig' with {
'item': item,
'level': level
} only
%}
{% endif %}
{% endfor %}
{% elseif activeResult.level == 3 %}
{% for item in navigationTree %}
{% if item.category.id in activeResult.path %}
{% sw_include '@Storefront/solution360/layout/sidebar/level-three-category-navigation.html.twig' with {
navigationTree: item.children,
activeResult: activeResult
} only %}
{% endif %}
{% endfor %}
{% elseif activeResult.level == 4 %}
{% for item in navigationTree %}
{% if item.category.id in activeResult.path %}
{% sw_include '@Storefront/solution360/layout/sidebar/level-four-category-navigation.html.twig' with {
navigationTree: item.children,
activeResult: activeResult
} only %}
{% endif %}
{% endfor %}
{% endif %}
{% endblock %}
{% endblock %}