custom/plugins/zenitPlatformStratus/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.         {% if theme_config('zen-main-navigation-subnavigation-style') is same as ('dropdown') and theme_config('zen-dropdown-navigation-trigger') is same as ('hover')%}
  6.             data-dropdown-menu="true"
  7.         {% else %}
  8.             data-flyout-menu="true"
  9.         {% endif %}>
  10.         {{ block('layout_main_navigation_navbar') }}
  11.         {{ block('layout_main_navigation_menu_flyout_wrapper') }}
  12.     </div>
  13. {% endblock %}
  14. {% block layout_main_navigation_menu_home %}
  15.     {% if theme_config('zen-main-navigation-home') is same as (true) %}
  16.         {% if context.salesChannel.translated.homeEnabled %}
  17.             {# ... remove active on home #}
  18.             <a class="nav-link main-navigation-link home-link"
  19.                href="{{ path('frontend.home.page') }}"
  20.                itemprop="url"
  21.                title="{{ homeLabel|striptags }}">
  22.                 {# ... add data-hover for hover animations #}
  23.                 <div class="main-navigation-link-text{% if treeItem.children|length > 0 %} has-children{% endif %}" data-hover="{{ homeLabel|striptags }}">
  24.                     <span class="main-navigation-link-name" itemprop="name" data-hover="{{ homeLabel|striptags }}">{{ homeLabel|sw_sanitize }}</span>
  25.                 </div>
  26.             </a>
  27.         {% endif %}
  28.     {% endif %}
  29. {% endblock %}
  30. {% block layout_main_navigation_menu_item %}
  31.     {# ... add navigation divider #}
  32.     {% if theme_config('zen-main-navigation-divider') is not same as (0) %}
  33.         {% if ( theme_config('zen-main-navigation-home') is same as (true) and loop.index == 1 ) or loop.index > 1 %}
  34.             <div class="main-navigation-divider" aria-hidden="true"></div>
  35.         {% endif %}
  36.     {% endif %}
  37.     {# ... add main-navigation-item #}
  38.     {% if theme_config('zen-main-navigation-subnavigation-style') is same as ('dropdown') %}
  39.         <div class="main-navigation-item dropdown dropdown-trigger-{{ theme_config('zen-dropdown-navigation-trigger') }}">
  40.     {% endif %}
  41.         {% if category.type == 'folder' %}
  42.             <div class="nav-link main-navigation-link"
  43.             {# ... add dropdown condition #}
  44.             {% if theme_config('zen-main-navigation-subnavigation-style') is same as ('dropdown') and treeItem.children|length > 0 %}
  45.                 data-dropdown-menu-trigger="{{ category.id }}"
  46.             {% elseif treeItem.children|length > 0 %}
  47.                 data-flyout-menu-trigger="{{ category.id }}"
  48.             {% endif %}
  49.             {% if theme_config('zen-main-navigation-subnavigation-style') is same as ('dropdown') and treeItem.children|length > 0 %}
  50.                 {% if theme_config('zen-dropdown-navigation-trigger') is same as ('click') %}
  51.                     data-toggle="dropdown"
  52.                     aria-expanded="false"
  53.                 {% endif %}
  54.             {% endif %}
  55.              title="{{ name }}">
  56.                 {# ... add data-hover for hover animations #}
  57.                 <div class="main-navigation-link-text{% if treeItem.children|length > 0 %} has-children{% endif %}" data-hover="{{ name }}">
  58.                     <span class="main-navigation-link-name" data-hover="{{ name }}" itemprop="name">{{ name }}</span>
  59.                     {# ... add navigation arrow #}
  60.                     {% if theme_config('zen-main-navigation-arrow') and treeItem.children|length > 0 %}
  61.                         {% sw_icon 'arrow-medium-down' style {
  62.                             'pack': 'solid', 'size': 'xs', 'class': 'main-navigation-link-toggle'
  63.                         } %}
  64.                     {% endif %}
  65.                     {# ... add badge #}
  66.                     {% sw_include '@zenitPlatformStratus/storefront/layout/navigation/zen-navigation-badge.html.twig' with {
  67.                         category: category,
  68.                     } only %}
  69.                 </div>
  70.             </div>
  71.         {% else %}
  72.             <a class="nav-link main-navigation-link{% if category.id == page.header.navigation.active.id or category.id in activePath %} active{% endif %}"
  73.            href="{{ category_url(category) }}"
  74.            itemprop="url"
  75.             {# ... add dropdown condition #}
  76.             {% if theme_config('zen-main-navigation-subnavigation-style') is same as ('dropdown') and treeItem.children|length > 0 %}
  77.                 data-dropdown-menu-trigger="{{ category.id }}"
  78.             {% elseif treeItem.children|length > 0 %}
  79.                 data-flyout-menu-trigger="{{ category.id }}"
  80.             {% endif %}
  81.             {% if theme_config('zen-main-navigation-subnavigation-style') is same as ('dropdown') and treeItem.children|length > 0 %}
  82.                 {% if theme_config('zen-dropdown-navigation-trigger') is same as ('click') %}
  83.                     data-toggle="dropdown"
  84.                     aria-expanded="false"
  85.                 {% endif %}
  86.             {% endif %}
  87.             {% if category_linknewtab(category) %}target="_blank"{% endif %}
  88.            title="{{ name }}">
  89.                 {# ... add data-hover for hover animations #}
  90.                 <div class="main-navigation-link-text{% if treeItem.children|length > 0 %} has-children{% endif %}" data-hover="{{ name }}">
  91.                     <span class="main-navigation-link-name" data-hover="{{ name }}" itemprop="name">{{ name }}</span>
  92.                     {# ... add navigation arrow #}
  93.                     {% if theme_config('zen-main-navigation-arrow') and treeItem.children|length > 0 %}
  94.                         {% sw_icon 'arrow-medium-down' style {'pack': 'solid', 'size': 'xs'} %}
  95.                     {% endif %}
  96.                     {# ... add badge #}
  97.                     {% sw_include '@zenitPlatformStratus/storefront/layout/navigation/zen-navigation-badge.html.twig' with {
  98.                         category: category,
  99.                     } only %}
  100.                 </div>
  101.             </a>
  102.         {% endif %}
  103.         {# ... add dropdown menu #}
  104.         {% if theme_config('zen-main-navigation-subnavigation-style') is same as ('dropdown') and treeItem.children|length > 0 %}
  105.             {% sw_include '@zenitPlatformStratus/storefront/layout/navigation/zen-dropdown.html.twig' with {
  106.                 navigationTree: treeItem,
  107.                 level: level+1,
  108.                 page: page,
  109.                 trigger: theme_config('zen-dropdown-navigation-trigger')
  110.             } only %}
  111.         {% endif %}
  112.     {# ... add main-navigation-item #}
  113.     {% if theme_config('zen-main-navigation-subnavigation-style') is same as ('dropdown') %}
  114.         </div>
  115.     {% endif %}
  116. {% endblock %}
  117. {% block layout_main_navigation_menu_flyout_wrapper %}
  118.     {% if theme_config('zen-main-navigation-subnavigation-style') is not same as ('dropdown') %}
  119.         {{ parent() }}
  120.     {% endif %}
  121. {% endblock %}
  122. {% block layout_main_navigation_menu_flyout %}
  123.     <div class="navigation-flyout"
  124.          data-flyout-menu-id="{{ treeItem.category.id }}">
  125.         {# ... add .navigation-flyout-inner #}
  126.         <div class="navigation-flyout-inner">
  127.             <div class="container">
  128.                 {% block layout_main_navigation_menu_flyout_include %}
  129.                     {% sw_include '@Storefront/storefront/layout/navigation/flyout.html.twig' with {navigationTree: treeItem, level: level+1, page: page} only %}
  130.                 {% endblock %}
  131.             </div>
  132.         </div>
  133.     </div>
  134. {% endblock %}