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

Open in your IDE?
  1. {% block layout_main_navigation %}
  2.     <div class="main-navigation"
  3.          id="mainNavigation"
  4.          data-flyout-menu="true">
  5.         {% block layout_main_navigation_navbar %}
  6.             <div class="container">
  7.                 {% block layout_main_navigation_menu %}
  8.                     <nav class="nav main-navigation-menu"
  9.                         itemscope="itemscope"
  10.                         itemtype="http://schema.org/SiteNavigationElement">
  11.                         {% block layout_main_navigation_menu_home %}
  12.                             <a class="nav-link main-navigation-link{% if controllerAction is same as('home') %} active{% endif %} home-link"
  13.                                 href="{{ path('frontend.home.page') }}"
  14.                                 itemprop="url"
  15.                                 title="{{ "general.homeLink"|trans|striptags }}">
  16.                                 <div class="main-navigation-link-text">
  17.                                     <span itemprop="name">{{ "general.homeLink"|trans|sw_sanitize }}</span>
  18.                                 </div>
  19.                             </a>
  20.                         {% endblock %}
  21.                         {% block layout_main_navigation_menu_items %}
  22.                             {% for treeItem in page.header.navigation.tree %}
  23.                                 {% set category = treeItem.category %}
  24.                                 {% set name = category.translated.name %}
  25.                                 {% set categorId = category.id %}
  26.                                 {% block layout_main_navigation_menu_item %}
  27.                                     {% if category.type == 'folder' %}
  28.                                         <div class="nav-link main-navigation-link"
  29.                                             {% if treeItem.children|length > 0 %}
  30.                                                 data-flyout-menu-trigger="{{ categorId }}"
  31.                                             {% endif %}
  32.                                               title="{{ name }}">
  33.                                             <div class="main-navigation-link-text">
  34.                                                 <span itemprop="name">{{ name }}</span>
  35.                                             </div>
  36.                                         </div>
  37.                                     {% else %}
  38.                                         <a class="nav-link main-navigation-link{% if categorId is same as(page.header.navigation.active.id) %} active{% endif %}"
  39.                                            href="{% if category.translated.externalLink %}{{ category.translated.externalLink }}{% else %}{{ seoUrl('frontend.navigation.page', { navigationId: categorId }) }}{% endif %}"
  40.                                            itemprop="url"
  41.                                             {% if treeItem.children|length > 0 %}
  42.                                                 data-flyout-menu-trigger="{{ categorId }}"
  43.                                             {% endif %}
  44.                                            title="{{ name }}">
  45.                                             <div class="main-navigation-link-text">
  46.                                                 <span itemprop="name">{{ name }}</span>
  47.                                             </div>
  48.                                         </a>
  49.                                     {% endif %}
  50.                                 {% endblock %}
  51.                             {% endfor %}
  52.                         {% endblock %}
  53.                     </nav>
  54.                 {% endblock %}
  55.             </div>
  56.         {% endblock %}
  57.         {% block layout_main_navigation_menu_flyout_wrapper %}
  58.             {% set navigationChildrenCount = 0 %}
  59.             {% for treeItem in page.header.navigation.tree %}
  60.                 {% if treeItem.category.childCount > 0 %}
  61.                     {% set navigationChildrenCount = navigationChildrenCount + 1 %}
  62.                 {% endif %}
  63.             {% endfor %}
  64.             {% if navigationChildrenCount > 0 %}
  65.                 {% block layout_main_navigation_menu_flyout_container %}
  66.                     <div class="navigation-flyouts">
  67.                         {% block layout_main_navigation_menu_flyouts %}
  68.                             {% for treeItem in page.header.navigation.tree %}
  69.                                 {% if treeItem.children|length > 0 %}
  70.                                     {% block layout_main_navigation_menu_flyout %}
  71.                                         <div class="navigation-flyout"
  72.                                              data-flyout-menu-id="{{ treeItem.category.id }}">
  73.                                             <div class="container">
  74.                                                 {% block layout_main_navigation_menu_flyout_include %}
  75.                                                     {% sw_include '@Storefront/storefront/layout/navigation/flyout.html.twig' with {navigationTree: treeItem, level: level+1, page: page} only %}
  76.                                                 {% endblock %}
  77.                                             </div>
  78.                                         </div>
  79.                                     {% endblock %}
  80.                                 {% endif %}
  81.                             {% endfor %}
  82.                         {% endblock %}
  83.                     </div>
  84.                 {% endblock %}
  85.             {% endif %}
  86.         {% endblock %}
  87.     </div>
  88. {% endblock %}