custom/plugins/HelmaTheme/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="mainStickyNavigation"
  5.          data-flyout-menu="true">
  6.         {% block layout_main_navigation_navbar %}
  7.             {{ parent() }}
  8.         {% endblock %}
  9.         {% block layout_main_navigation_menu_flyout_wrapper %}
  10.             {{ parent() }}
  11.         {% endblock %}
  12.     </div>
  13. {% endblock %}
  14. {% block layout_main_navigation_menu %}
  15.     {{ parent() }}
  16. {% endblock %}
  17. {% block layout_main_navigation_menu_items %}
  18.     {% for treeItem in page.header.navigation.tree %}
  19.         {% set category = treeItem.category %}
  20.         {% set name = category.translated.name %}
  21.         {% set categorId = category.id %}
  22.         {% block layout_main_navigation_menu_item %}
  23.             {% if category.type == 'folder' %}
  24.                 <div class="nav-link main-navigation-link"
  25.                     {% if treeItem.children|length > 0 %}
  26.                         data-flyout-menu-trigger="{{ categorId }}"
  27.                     {% endif %}
  28.                      title="{{ name }}">
  29.                     <div class="main-navigation-link-text">
  30.                         <span itemprop="name">{{ name }}</span>
  31.                     </div>
  32.                 </div>
  33.             {% else %}
  34.                 <div class="nav-dropdown-link">
  35.                     {% if category.translated.customFields.custom_category_field_only_logged %}
  36.                         {% if context.customer %}
  37.                             <a class="nav-link main-navigation-link{% if categorId is same as(page.header.navigation.active.id) or categorId is same as(page.header.navigation.active.parentId) %} active{% endif %}"
  38.                                 href="{% if category.externalLink %}{{ category.externalLink }}{% else %}{{ seoUrl('frontend.navigation.page', { navigationId: categorId }) }}{% endif %}"
  39.                                 itemprop="url"
  40.                                     {% if treeItem.children|length > 0 %}
  41.                                         data-flyout-menu-trigger="{{ categorId }}"
  42.                                     {% endif %}
  43.                                 title="{{ name }}">
  44.                                     <div class="main-navigation-link-text">
  45.                                         <span itemprop="name">{{ name }}</span>
  46.                                     </div>
  47.                             </a>
  48.                         {% else %}
  49.                             <a class="nav-link main-navigation-link{% if categorId is same as(page.header.navigation.active.id) or categorId is same as(page.header.navigation.active.parentId) %} active{% endif %}"
  50.                                 href="{{ path('frontend.account.login.page', {redirectTo: 'frontend.navigation.page', redirectParameters:'{"navigationId":"'~categorId~'"}'}) }}"
  51.                                 itemprop="url"
  52.                                     {% if treeItem.children|length > 0 %}
  53.                                         data-flyout-menu-trigger="{{ categorId }}"
  54.                                     {% endif %}
  55.                                 title="{{ name }}">
  56.                                     <div class="main-navigation-link-text">
  57.                                         <span itemprop="name">{{ name }}</span>
  58.                                     </div>
  59.                             </a>
  60.                         {% endif %}
  61.                     {% else %}
  62.                         <a class="nav-link main-navigation-link{% if categorId is same as(page.header.navigation.active.id) or categorId is same as(page.header.navigation.active.parentId) %} active{% endif %}"
  63.                             href="{% if category.externalLink %}{{ category.externalLink }}{% else %}{{ seoUrl('frontend.navigation.page', { navigationId: categorId }) }}{% endif %}"
  64.                             itemprop="url"
  65.                                 {% if treeItem.children|length > 0 %}
  66.                                     data-flyout-menu-trigger="{{ categorId }}"
  67.                                 {% endif %}
  68.                             title="{{ name }}">
  69.                                 <div class="main-navigation-link-text">
  70.                                     <span itemprop="name">{{ name }}</span>
  71.                                 </div>
  72.                         </a>
  73.                     {% endif %}
  74.                     {% sw_include '@Storefront/storefront/layout/navigation/navigation-dropdown.html.twig' with {
  75.                         childrenTree: treeItem.children
  76.                     } %}
  77.                 </div>
  78.             {% endif %}
  79.         {% endblock %}
  80.     {% endfor %}
  81. {% endblock %}
  82. {% block layout_main_navigation_menu_flyout_container %}
  83. {% endblock %}