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.     <div class="{% if level == 0 %}row {% endif %}navigation-flyout-categories is-level-{{ level }}">
  8.         {% for treeItem in navigationTree %}
  9.             {% set id = treeItem.category.id %}
  10.             {% set name = treeItem.category.translated.name %}
  11.             {% set link = treeItem.category.externalLink %}
  12.             {% block layout_navigation_categories_item %}
  13.                 <div class="{% if level == 0 %}{% if navigationMedia %}col-4 {% else %}col-3 {% endif %}{% endif %}navigation-flyout-col">
  14.                     {% block layout_navigation_categories_item_link %}
  15.                         {% if treeItem.category.type == 'folder' %}
  16.                             <div class="nav-item nav-link navigation-flyout-link is-level-{{ level }}"
  17.                                  title="{{ name }}">
  18.                                 <span itemprop="name">{{ name }}</span>
  19.                             </div>
  20.                         {% else %}
  21.                             <a class="nav-item nav-link navigation-flyout-link is-level-{{ level }}{% if id is same as(activeId) %} active{% endif %}"
  22.                                href="{% if link %}{{ link }}{% else %}{{ seoUrl('frontend.navigation.page', { navigationId: id }) }}{% endif %}"
  23.                                itemprop="url"
  24.                                title="{{ name }}">
  25.                                 <span itemprop="name">{{ name }}</span>
  26.                             </a>
  27.                         {% endif %}
  28.                     {% endblock %}
  29.                     {% block layout_navigation_categories_recoursion %}
  30.                         {% if level < navigationMaxDepth %}
  31.                             {% sw_include '@Storefront/storefront/layout/navigation/categories.html.twig' with {
  32.                                 navigationTree: treeItem.children,
  33.                                 level: level + 1,
  34.                                 page: page
  35.                             } only %}
  36.                         {% endif %}
  37.                     {% endblock %}
  38.                 </div>
  39.             {% endblock %}
  40.         {% endfor %}
  41.     </div>
  42. {% endblock %}