custom/plugins/DmSanettaTheme/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" id="mainNavigation" data-flyout-menu="true">
  4.         {% block layout_main_navigation_navbar %}
  5.             <div
  6.                 class="container dm_main-navigation-wrapper">
  7.                 <!-- Logo -->
  8.                 {% block layout_header_logo %}
  9.                     <div class="logo-container">
  10.                         {% sw_include '@Storefront/storefront/layout/header/logo.html.twig' %}
  11.                     </div>
  12.                 {% endblock %}
  13.                 <!-- Navigation -->
  14.                 {% block layout_main_navigation_menu %}
  15.                     <nav class="nav main-navigation-menu" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement">
  16.                         {% set homeLabel = context.salesChannel.translated.homeName|default("general.homeLink"|trans) %}
  17.                         {% block layout_main_navigation_menu_home %}
  18.                             {% if context.salesChannel.translated.homeEnabled %}
  19.                                 <a class="nav-link main-navigation-link{% if controllerAction is same as('home') %} active{% endif %} home-link" href="{{ path('frontend.home.page') }}" itemprop="url" title="{{ homeLabel|striptags }}">
  20.                                     <div class="main-navigation-link-text">
  21.                                         <span itemprop="name">{{ homeLabel|sw_sanitize }}</span>
  22.                                     </div>
  23.                                 </a>
  24.                             {% endif %}
  25.                         {% endblock %}
  26.                         {% block layout_main_navigation_menu_items %}
  27.                             {% if page.product is defined %}
  28.                                 {% set activePath = page.product.categoryTree %}
  29.                             {% else %}
  30.                                 {% set activePath = page.header.navigation.active.path %}
  31.                             {% endif %}
  32.                             {% for treeItem in page.header.navigation.tree %}
  33.                                 {% set category = treeItem.category %}
  34.                                 {% set name = category.translated.name %}
  35.                                 {# @deprecated tag:v6.5.0 - Use "category.id" directly instead. #}
  36.                                 {% set categorId = category.id %}
  37.                                 {% block layout_main_navigation_menu_item %}
  38.                                     {% if category.type == 'folder' %}
  39.                                         <div class="nav-link main-navigation-link" {% if treeItem.children|length > 0 %} data-flyout-menu-trigger="{{ category.id }}" {% endif %} title="{{ name }}">
  40.                                             <div class="main-navigation-link-text">
  41.                                                 <span itemprop="name">{{ name }}</span>
  42.                                             </div>
  43.                                         </div>
  44.                                     {% else %}
  45.                                         <a class="nav-link main-navigation-link{% if category.id == page.header.navigation.active.id or category.id in activePath %} active{% endif %}" href="{{ category_url(category) }}" itemprop="url" {% if treeItem.children|length > 0 %} data-flyout-menu-trigger="{{ category.id }}" {% endif %} {% if category_linknewtab(category) %} target="_blank" {% endif %} title="{{ name }}">
  46.                                             <div class="main-navigation-link-text">
  47.                                                 <span itemprop="name">{{ name }}</span>
  48.                                             </div>
  49.                                         </a>
  50.                                     {% endif %}
  51.                                 {% endblock %}
  52.                             {% endfor %}
  53.                         {% endblock %}
  54.                     </nav>
  55.                     <div class="header-search-col">
  56.                         <div class="row">
  57.                             <div class="col-sm-auto d-none d-sm-block d-lg-none">
  58.                                 <div class="nav-main-toggle">
  59.                                     <button class="btn nav-main-toggle-btn header-actions-btn" type="button" data-offcanvas-menu="true" aria-label="{{ "general.menuLink"|trans|striptags }}">
  60.                                         {% sw_icon 'stack' %}
  61.                                     </button>
  62.                                 </div>
  63.                             </div>
  64.                             <div class="">
  65.                                 {% sw_include '@Storefront/storefront/layout/header/search.html.twig' %}
  66.                             </div>
  67.                         </div>
  68.                     </div>
  69.                     <div class="header-actions-col">
  70.                         <div class="row {{ gridNoGuttersClass }}">
  71.                             {% if config('core.cart.wishlistEnabled') %}
  72.                                 {% if context.customer %}
  73.                                     <div class="col-auto">
  74.                                         <div class="header-wishlist">
  75.                                             <a class="btn header-wishlist-btn header-actions-btn" href="{{ path('frontend.wishlist.page') }}" title="{{ 'header.wishlist'|trans|striptags }}" aria-label="{{ 'header.wishlist'|trans|striptags }}">
  76.                                                 {% sw_include '@Storefront/storefront/layout/header/actions/wishlist-widget.html.twig' %}
  77.                                             </a>
  78.                                         </div>
  79.                                     </div>
  80.                                 {% endif %}
  81.                             {% endif %}
  82.                             <div class="col-auto">
  83.                                 <div class="account-menu">
  84.                                     <div class="dropdown">
  85.                                         <button class="btn account-menu-btn header-actions-btn" type="button" id="accountWidgetSticky" data-offcanvas-account-menu="true" {{ dataBsToggleAttr }}="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="{{ "account.myAccount"|trans|striptags }}" title="{{ "account.myAccount"|trans|striptags }}">
  86.                                             {% sw_icon 'avatar' %}
  87.                                         </button>
  88.                                         <div class="dropdown-menu dropdown-menu-right account-menu-dropdown js-account-menu-dropdown" aria-labelledby="accountWidgetSticky">
  89.                                             {% sw_include '@Storefront/storefront/layout/header/account-menu.html.twig' %}
  90.                                         </div>
  91.                                     </div>
  92.                                 </div>
  93.                             </div>
  94.                             <div class="col-auto">
  95.                                 <div class="header-cart" data-offcanvas-cart="true">
  96.                                     <a class="btn header-cart-btn header-actions-btn" href="{{ path('frontend.checkout.cart.page') }}" data-cart-widget="true" title="{{ 'checkout.cartTitle'|trans|striptags }}" aria-label="{{ 'checkout.cartTitle'|trans|striptags }}">
  97.                                         {% sw_include '@Storefront/storefront/layout/header/actions/cart-widget.html.twig' %}
  98.                                     </a>
  99.                                 </div>
  100.                             </div>
  101.                         </div>
  102.                     </div>
  103.                 {% endblock %}
  104.             </div>
  105.         {% endblock %}
  106.         {% block layout_main_navigation_menu_flyout_wrapper %}
  107.             {% set navigationChildrenCount = 0 %}
  108.             {% for treeItem in page.header.navigation.tree %}
  109.                 {% if treeItem.category.childCount > 0 %}
  110.                     {% set navigationChildrenCount = navigationChildrenCount + 1 %}
  111.                 {% endif %}
  112.             {% endfor %}
  113.             {% if navigationChildrenCount > 0 %}
  114.                 {% block layout_main_navigation_menu_flyout_container %}
  115.                     <div class="navigation-flyouts">
  116.                         {% block layout_main_navigation_menu_flyouts %}
  117.                             {% for treeItem in page.header.navigation.tree %}
  118.                                 {% if treeItem.children|length > 0 %}
  119.                                     {% block layout_main_navigation_menu_flyout %}
  120.                                         <div class="navigation-flyout" data-flyout-menu-id="{{ treeItem.category.id }}">
  121.                                             <div class="container">
  122.                                                 {% block layout_main_navigation_menu_flyout_include %}
  123.                                                     {% sw_include '@Storefront/storefront/layout/navigation/flyout.html.twig' with {navigationTree: treeItem, level: level+1, page: page} only %}
  124.                                                 {% endblock %}
  125.                                             </div>
  126.                                         </div>
  127.                                     {% endblock %}
  128.                                 {% endif %}
  129.                             {% endfor %}
  130.                         {% endblock %}
  131.                     </div>
  132.                 {% endblock %}
  133.             {% endif %}
  134.         {% endblock %}
  135.     </div>
  136. {% endblock %}