custom/plugins/zenitPlatformSphere/src/Resources/views/storefront/layout/header/header.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/layout/header/header.html.twig' %}
  2. {% block layout_header %}
  3.     {% set topBarStyle = theme_config('zen-top-bar-style') %}
  4.     {% if theme_config('zen-top-bar-style') is same as ('hidden') and (page.header.languages.count > 1 or page.header.currencies.count > 1 or config('zenitPlatformSphere.config.marketingActive')) %}
  5.         {% set topBarStyle = 'offcanvas' %}
  6.     {% else %}
  7.         {% set topBarStyle = theme_config('zen-top-bar-style') %}
  8.     {% endif %}
  9.     {% block layout_top_bar %}
  10.         {% if topBarStyle is same as('offcanvas') %}
  11.             {% if theme_config('zen-header-style') is not same as ('two-line') or (theme_config('zen-header-style') is same as ('two-line') and config('zenitPlatformSphere.config.marketingActive')) %}
  12.                 <div class="d-none js-top-bar-offcanvas-initial-content">
  13.                     {% sw_include '@Storefront/storefront/layout/header/zen-top-bar-offcanvas.html.twig' with {topBarStyle: topBarStyle} %}
  14.                 </div>
  15.             {% endif %}
  16.         {% else %}
  17.             {% if theme_config('zen-header-style') is not same as ('two-line') or (theme_config('zen-header-style') is same as ('two-line') and config('zenitPlatformSphere.config.marketingActive')) %}
  18.                 <div class="collapse{% if topBarStyle is same as ('collapsible') or topBarStyle is same as ('default') %} show{% endif %}"
  19.                      id="topBarCollapse">
  20.                     {% sw_include '@Storefront/storefront/layout/header/top-bar.html.twig' with {topBarStyle: topBarStyle} %}
  21.                 </div>
  22.             {% endif %}
  23.         {% endif %}
  24.     {% endblock %}
  25.     {% block layout_header_navigation %}
  26.         <div class="nav-header {{ navHeaderClasses|join(' ') }}">
  27.             <div class="container">
  28.                 <div class="header-row row header-gutters align-items-center {{ headerRowClasses }}">
  29.                     {% block layout_header_logo %}
  30.                         <div class="header-logo-col {{ logoClasses }}">
  31.                             {% sw_include '@Storefront/storefront/layout/header/logo.html.twig' %}
  32.                         </div>
  33.                     {% endblock %}
  34.                     {% if theme_config('zen-header-style') is same as ('single-line') %}
  35.                         {% block layout_header_main_navigation %}
  36.                             <div class="header-nav-col nav-main {{ mainNavigationClasses }} {{ navMainClasses|join(' ') }}">
  37.                                 {% block layout_header_main_navigation_inner %}
  38.                                     {% sw_include '@Storefront/storefront/layout/navigation/navigation.html.twig' %}
  39.                                 {% endblock %}
  40.                             </div>
  41.                         {% endblock %}
  42.                     {% endif %}
  43.                     {% if theme_config('zen-header-style') is same as ('two-line') %}
  44.                         {% block zen_layout_header_top_bar %}
  45.                             <div class="header-top-bar-col {{ topBarClasses }}">
  46.                                 <div class="row no-gutters">
  47.                                     {% block zen_layout_navigation_offcanvas_navigation_action_language %}
  48.                                         {% sw_include '@Storefront/storefront/layout/header/actions/language-widget.html.twig' %}
  49.                                     {% endblock %}
  50.                                     {% block zen_layout_navigation_offcanvas_navigation_action_currency %}
  51.                                         {% sw_include '@Storefront/storefront/layout/header/actions/currency-widget.html.twig' %}
  52.                                     {% endblock %}
  53.                                     {% block zen_layout_navigation_offcanvas_navigation_action_service %}
  54.                                         {% sw_include '@Storefront/storefront/layout/header/actions/service-menu-widget.html.twig' %}
  55.                                     {% endblock %}
  56.                                 </div>
  57.                             </div>
  58.                         {% endblock %}
  59.                     {% endif %}
  60.                     {% block layout_header_navigation_toggle %}
  61.                         <div class="header-menu-button {{ mainNavigationToggleClasses }}">
  62.                             {% block layout_header_navigation_toggle_button %}
  63.                                 <button class="btn nav-main-toggle-btn header-actions-btn"
  64.                                         type="button"
  65.                                         data-offcanvas-menu="true"
  66.                                         aria-label="{{ "general.menuLink"|trans|striptags }}">
  67.                                     {% block layout_header_navigation_toggle_button_icon %}
  68.                                         {% sw_icon 'stack' %}
  69.                                     {% endblock %}
  70.                                 </button>
  71.                             {% endblock %}
  72.                         </div>
  73.                     {% endblock %}
  74.                     {% block layout_header_search %}
  75.                         {% if theme_config('zen-search-style') is not same as('expandable') %}
  76.                             <div class="header-search-col {{ searchClasses }}">
  77.                                 {% sw_include '@Storefront/storefront/layout/header/search.html.twig' %}
  78.                             </div>
  79.                         {% endif %}
  80.                     {% endblock %}
  81.                     {% block layout_header_actions %}
  82.                         <div class="header-actions-col {{ actionClasses }}">
  83.                             <div class="row no-gutters{% if theme_config('zen-logo-position') is not same as ('right') %} justify-content-end{% endif %}">
  84.                                 {% block layout_header_search_toggle %}
  85.                                     <div class="col-auto{% if theme_config('zen-search-style') is same as('default') %} d-sm-none"{% endif %}">
  86.                                         <div class="search-toggle">
  87.                                             <button class="btn header-actions-btn search-toggle-btn js-search-toggle-btn collapsed"
  88.                                                     type="button"
  89.                                                     {% if theme_config('zen-search-style') is same as('overlay') %}
  90.                                                         data-toggle="overlay"
  91.                                                     {% else %}
  92.                                                         data-toggle="collapse"
  93.                                                         data-target="#searchCollapse"
  94.                                                         aria-expanded="false"
  95.                                                         aria-controls="searchCollapse"
  96.                                                     {% endif %}
  97.                                                     aria-label="{{ "header.searchButton"|trans|striptags }}">
  98.                                                 {% sw_icon 'search' %}
  99.                                                 {% sw_icon 'x' style { 'class': 'search-close d-none' } %}
  100.                                             </button>
  101.                                         </div>
  102.                                     </div>
  103.                                 {% endblock %}
  104.                                 {% if config('core.cart.wishlistEnabled') %}
  105.                                     {% block layout_header_actions_wishlist %}
  106.                                         <div class="col-auto">
  107.                                             <div class="header-wishlist">
  108.                                                 <a class="btn header-wishlist-btn header-actions-btn"
  109.                                                    href="{{ path('frontend.wishlist.page') }}"
  110.                                                    title="{{ 'header.wishlist'|trans|striptags }}"
  111.                                                    aria-label="{{ 'header.wishlist'|trans|striptags }}">
  112.                                                     {% sw_include '@Storefront/storefront/layout/header/actions/wishlist-widget.html.twig' %}
  113.                                                 </a>
  114.                                             </div>
  115.                                         </div>
  116.                                     {% endblock %}
  117.                                 {% endif %}
  118.                                 {% block layout_header_actions_account %}
  119.                                     <div class="col-auto">
  120.                                         <div class="account-menu">
  121.                                             {% sw_include '@Storefront/storefront/layout/header/actions/account-widget.html.twig' %}
  122.                                         </div>
  123.                                     </div>
  124.                                 {% endblock %}
  125.                                 {% block layout_header_actions_cart %}
  126.                                     <div class="col-auto">
  127.                                         <div class="header-cart"
  128.                                              data-offcanvas-cart="true">
  129.                                             <a class="btn header-cart-btn header-actions-btn"
  130.                                                href="{{ path('frontend.checkout.cart.page') }}"
  131.                                                data-cart-widget="true"
  132.                                                title="{{ 'checkout.cartTitle'|trans|striptags }}"
  133.                                                aria-label="{{ 'checkout.cartTitle'|trans|striptags }}">
  134.                                                 {% sw_include '@Storefront/storefront/layout/header/actions/cart-widget.html.twig' %}
  135.                                             </a>
  136.                                         </div>
  137.                                     </div>
  138.                                 {% endblock %}
  139.                                 {% block zen_layout_header_top_bar_toggle %}
  140.                                     {# marketingBannerId is needed for storagekey invalidation #}
  141.                                     {% set marketingBanner = [] %}
  142.                                     {% set marketingBanner = [config('zenitPlatformSphere.config.marketingActive')]|merge(marketingBanner) %}
  143.                                     {% set marketingBanner = [config('zenitPlatformSphere.config.marketingText')]|merge(marketingBanner) %}
  144.                                     {% set marketingBanner = [config('zenitPlatformSphere.config.marketingButtonText')]|merge(marketingBanner) %}
  145.                                     {% set marketingBanner = [config('zenitPlatformSphere.config.marketingButtonLink')]|merge(marketingBanner) %}
  146.                                     {% set marketingBanner = [config('zenitPlatformSphere.config.marketingButtonTarget')]|merge(marketingBanner) %}
  147.                                     {% set marketingBannerId = marketingBanner|json_encode()|length %}
  148.                                     {% set zenCollapseTopBarOptions = {
  149.                                         id: topBarStyle ~ '-' ~ marketingBannerId,
  150.                                         type: topBarStyle
  151.                                     } %}
  152.                                     {% if topBarStyle is not same as ('default') and topBarStyle is not same as ('hidden')  %}
  153.                                         {% if theme_config('zen-header-style') is not same as ('two-line') or (theme_config('zen-header-style') is same as ('two-line') and config('zenitPlatformSphere.config.marketingActive')) %}
  154.                                             <div class="col-auto d-none d-lg-block">
  155.                                                 <div class="top-bar-toggle">
  156.                                                     <button class="btn header-actions-btn top-bar-toggle-btn"
  157.                                                             type="button"
  158.                                                             aria-label="{{ "zentheme.general.moreLink"|trans|striptags }}"
  159.                                                         {% if topBarStyle is same as ('offcanvas') %}
  160.                                                             data-offcanvas-top-bar="true"
  161.                                                         {% endif %}
  162.                                                         {% if topBarStyle is same as ('collapsible') %}
  163.                                                             data-toggle="collapse"
  164.                                                             data-target="#topBarCollapse"
  165.                                                             aria-expanded="true"
  166.                                                             data-zen-collapse-top-bar-options="{{ zenCollapseTopBarOptions|json_encode }}"
  167.                                                         {% endif %}
  168.                                                         {% if topBarStyle is same as ('expandable') %}
  169.                                                             data-toggle="collapse"
  170.                                                             data-target="#topBarCollapse"
  171.                                                             aria-expanded="false"
  172.                                                             data-zen-collapse-top-bar-options="{{ zenCollapseTopBarOptions|json_encode }}"
  173.                                                         {% endif %}>
  174.                                                         {% if theme_config('zen-main-navigation-style') is same as ('offcanvas-lg') or theme_config('zen-main-navigation-style') is same as ('offcanvas-xl') %}
  175.                                                             {% sw_icon 'more-vertical' %}
  176.                                                         {% else %}
  177.                                                             {% sw_icon 'stack' %}
  178.                                                         {% endif %}
  179.                                                     </button>
  180.                                                 </div>
  181.                                             </div>
  182.                                         {% endif %}
  183.                                     {% endif %}
  184.                                 {% endblock %}
  185.                             </div>
  186.                         </div>
  187.                     {% endblock %}
  188.                 </div>
  189.             </div>
  190.             {% block layout_header_search_expandable %}
  191.                 {% if theme_config('zen-search-style') is same as('expandable') %}
  192.                     <div class="header-search-col">
  193.                         {% sw_include '@Storefront/storefront/layout/header/search.html.twig' %}
  194.                     </div>
  195.                 {% endif %}
  196.             {% endblock %}
  197.         </div>
  198.     {% endblock %}
  199. {% endblock %}