vendor/shopware/storefront/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"
  30.                                    {% if treeItem.category.linkType == "external" %}rel="noopener noreferrer"{% endif %}
  31.                                {% endif %}
  32.                                title="{{ name }}">
  33.                                 <span itemprop="name">{{ name }}</span>
  34.                             </a>
  35.                         {% endif %}
  36.                     {% endblock %}
  37.                     {% block layout_navigation_categories_recoursion %}
  38.                         {% if level < navigationMaxDepth %}
  39.                             {% sw_include '@Storefront/storefront/layout/navigation/categories.html.twig' with {
  40.                                 navigationTree: treeItem.children,
  41.                                 level: level + 1,
  42.                                 page: page
  43.                             } only %}
  44.                         {% endif %}
  45.                     {% endblock %}
  46.                 </div>
  47.             {% endblock %}
  48.         {% endfor %}
  49.     </div>
  50. {% endblock %}