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

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