vendor/shopware/storefront/Resources/views/storefront/layout/sidebar/category-navigation.html.twig line 1

Open in your IDE?
  1. {% block layout_navigation_categories %}
  2.     {% set navigationMaxDepth = context.salesChannel.navigationCategoryDepth %}
  3.     {% if not level %}
  4.         {% set level = 0 %}
  5.     {% endif %}
  6.     {% block layout_navigation_categories_list %}
  7.         <ul class="category-navigation level-{{ level }}">
  8.             {% for item in navigationTree %}
  9.                 {% block layout_navigation_categories_list_entry %}
  10.                     <li class="category-navigation-entry">
  11.                         {% if (item.category.id in activeResult.id) or (item.category.id in activeResult.path) %}
  12.                             {% if item.category.type == 'folder' %}
  13.                                 {% block layout_navigation_categories_folder_children %}
  14.                                     <span class="category-navigation-link">{{ item.category.translated.name }}</span>
  15.                                 {% endblock %}
  16.                             {% else %}
  17.                                 {% block layout_navigation_categories_link_children %}
  18.                                     <a class="category-navigation-link{% if item.category.id is same as(activeResult.id) %} is-active{% endif %}{% if item.category.id in activeResult.path %} in-path{% endif %}"
  19.                                         href="{{ category_url(item.category) }}"
  20.                                         {% if category_linknewtab(item.category) %}target="_blank"{% endif %}>
  21.                                         {% block layout_navigation_categories_link_children_name %}
  22.                                             {{ item.category.translated.name }}
  23.                                         {% endblock %}
  24.                                     </a>
  25.                                 {% endblock %}
  26.                             {% endif %}
  27.                             {% block layout_navigation_categories_recoursion %}
  28.                                 {% if level < navigationMaxDepth %}
  29.                                     {% sw_include '@Storefront/storefront/layout/sidebar/category-navigation.html.twig' with {
  30.                                         navigationTree: item.children,
  31.                                         activeResult: activeResult,
  32.                                         level: level + 1
  33.                                     } only %}
  34.                                 {% endif %}
  35.                             {% endblock %}
  36.                         {% else %}
  37.                             {% if item.category.type == 'folder' %}
  38.                                 {% block layout_navigation_categories_text %}
  39.                                     <span class="category-navigation-link">{{ item.category.translated.name }}</span>
  40.                                 {% endblock %}
  41.                             {% else %}
  42.                                 {% block layout_navigation_categories_link %}                        
  43.                                     <a class="category-navigation-link{% if item.category.id is same as(activeResult.id) %} is-active{% endif %}"
  44.                                         href="{{ category_url(item.category) }}"
  45.                                         {% if category_linknewtab(item.category) %}target="_blank"{% endif %}>
  46.                                         {% block layout_navigation_categories_link_name %}
  47.                                             {{ item.category.translated.name }}
  48.                                         {% endblock %}
  49.                                     </a>
  50.                                 {% endblock %}
  51.                             {% endif %}
  52.                         {% endif %}
  53.                     </li>
  54.                 {% endblock %}
  55.             {% endfor %}
  56.         </ul>
  57.     {% endblock %}
  58. {% endblock %}