{% block element_subcategories_navigation %}
<div class="cms-element-subcategories-simple-navigation">
{% set menuEntry = '' %}
{% if page.footer.navigation.active.path %}
{% set activePath = page.footer.navigation.active.path|split('|') %}
{% set activePath = activePath|slice(2, length-1) %}
{% set currentPageId = page.footer.navigation.active.id %}
{% set activePath = activePath|merge([currentPageId]) %}
{% set menuItem = page.header.navigation.tree[(activePath|first)] %}
{% set activePath = activePath|slice(1, length) %}
{% for category in activePath %}
{% set menuItem = menuItem.children[category] %}
{% endfor %}
{% set menuEntry = menuItem.children %}
{% elseif page.footer.navigation.active.level == 1 %}
{% set menuEntry = page.header.navigation.tree %}
{% endif %}
{% if menuEntry != [] and menuEntry != '' %}
<div class="subcategories-navigation-simple-container">
{% for menuItemChild in menuEntry %}
{% set childCategory = menuItemChild.category %}
<a class="subcategories-navigation-simple-link" href="{{ category_url(childCategory) }}">
<div class="subcategories-navigation-simple-link-item">
<span class="subcategories-navigation-simple-link-text">{{ childCategory.name }}</span>
</div>
</a>
{% endfor %}
</div>
{% endif %}
</div>
{% endblock %}