custom/static-plugins/CytexTheme/src/Resources/views/storefront/element/cms-element-subcategories-navigation-simple.html.twig line 1

Open in your IDE?
  1. {% block element_subcategories_navigation %}
  2.     <div class="cms-element-subcategories-simple-navigation">
  3.         {% set menuEntry = '' %}
  4.         {% if page.footer.navigation.active.path %}
  5.             {% set activePath = page.footer.navigation.active.path|split('|') %}
  6.             {% set activePath = activePath|slice(2, length-1) %}
  7.             {% set currentPageId = page.footer.navigation.active.id %}
  8.             {% set activePath = activePath|merge([currentPageId]) %}
  9.             {% set menuItem = page.header.navigation.tree[(activePath|first)] %}
  10.             {% set activePath = activePath|slice(1, length) %}
  11.             {% for category in activePath %}
  12.                 {% set menuItem = menuItem.children[category] %}
  13.             {% endfor %}
  14.             {% set menuEntry = menuItem.children %}
  15.         {% elseif page.footer.navigation.active.level == 1 %}
  16.             {% set menuEntry = page.header.navigation.tree %}
  17.         {% endif %}
  18.         {% if menuEntry != [] and menuEntry != '' %}
  19.             <div class="subcategories-navigation-simple-container">
  20.                 {% for menuItemChild in menuEntry %}
  21.                     {% set childCategory = menuItemChild.category %}
  22.                     <a class="subcategories-navigation-simple-link" href="{{ category_url(childCategory) }}">
  23.                         <div class="subcategories-navigation-simple-link-item">
  24.                             <span class="subcategories-navigation-simple-link-text">{{ childCategory.name }}</span>
  25.                         </div>
  26.                     </a>
  27.                 {% endfor %}
  28.             </div>
  29.         {% endif %}
  30.     </div>
  31. {% endblock %}