custom/plugins/KayloBasicTheme/src/Resources/views/storefront/layout/navigation/categories.html.twig line 1

Open in your IDE?
  1. {% block layout_navigation_categories %}
  2.     {% set navigationMaxDepth = 3 %}
  3.     {% if not level %}
  4.         {% set level = 0 %}
  5.     {% endif %}
  6.     {% set activeId = page.header.navigation.active.id %}
  7.     {% if page.product is defined %}
  8.         {% set activePath = page.product.categoryTree %}
  9.     {% else %}
  10.         {% set activePath = page.header.navigation.active.path %}
  11.     {% endif %}
  12.     <div class="{% if level == 0 %}row {% endif %}navigation-flyout-categories is-level-{{ level }}">
  13.         {% for treeItem in navigationTree %}
  14.             {% set id = treeItem.category.id %}
  15.             {% set name = treeItem.category.translated.name %}
  16.             {% set link = category_url(treeItem.category) %}
  17.             {% block layout_navigation_categories_item %}
  18.                 <div class="{% if level == 0 %}{% if navigationMedia %}col-4 {% else %}col-3 {% endif %}{% endif %}navigation-flyout-col">
  19.                     {% block layout_navigation_categories_item_link %}
  20.                         {% if treeItem.category.type == 'folder' %}
  21.                             <div class="nav-item nav-link navigation-flyout-link is-level-{{ level }}"
  22.                                  title="{{ name }}">
  23.                                 <span itemprop="name">{{ name }}</span>
  24.                             </div>
  25.                         {% else %}
  26.                             <a class="nav-item nav-link navigation-flyout-link is-level-{{ level }}{% if id == activeId or id in activePath %} active{% endif %}"
  27.                                href="{{ link }}"
  28.                                itemprop="url"
  29.                                {% if category_linknewtab(treeItem.category) %}target="_blank"{% endif %}
  30.                                title="{{ name }}">
  31.                                 <span itemprop="name">{{ name }}</span>
  32.                             </a>
  33.                         {% endif %}
  34.                     {% endblock %}
  35.                     {% block layout_navigation_categories_recoursion %}
  36.                         {% if level < navigationMaxDepth %}
  37.                             {% sw_include '@Storefront/storefront/layout/navigation/categories.html.twig' with {
  38.                                 navigationTree: treeItem.children,
  39.                                 level: level + 1,
  40.                                 page: page
  41.                             } only %}
  42.                         {% endif %}
  43.                     {% endblock %}
  44.                 </div>
  45.             {% endblock %}
  46.         {% endfor %}
  47.     </div>
  48. {% endblock %}