custom/static-plugins/SamsonCustomer/src/Resources/views/storefront/base.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/base.html.twig' %}
  2. {% set bodyClasses = [] %}
  3. {% if page.cmsPage %}
  4.     {% set hideBreadcrumbIdx = constant('Samson\\CustomFieldSet\\Constants\\CmsPageCustomFieldConstants::CUSTOM_FIELD_BREADCRUMB_HIDE') %}
  5.     {% set hideBreadcrumb = page.cmsPage.customFields[hideBreadcrumbIdx] %}
  6.     {% set noTopMarginIdx = constant('Samson\\CustomFieldSet\\Constants\\CmsPageCustomFieldConstants::CUSTOM_FIELD_STYLE_NO_TOP_MARGIN') %}
  7.     {% set noTopMargin = page.cmsPage.customFields[noTopMarginIdx] %}
  8.     {% if page.cmsPage.type %}
  9.         {% set bodyClasses = ["cms-page-type-" ~ page.cmsPage.type]|merge(bodyClasses) %}
  10.     {% endif %}
  11.     {% if hideBreadcrumb %}
  12.         {% set bodyClasses = ["cms-page-hide-breadcrumb"]|merge(bodyClasses) %}
  13.     {% endif %}
  14.     {% if noTopMargin %}
  15.         {% set bodyClasses = ["cms-page-no-top-margin"]|merge(bodyClasses) %}
  16.     {% endif %}
  17. {% endif %}
  18. {%- block base_body_classes -%}
  19.     {#
  20.         produces nicely formatted classlist like this
  21.         <body class="is-ctl-navigation is-act-index cms-page-hide-breadcrumb cms-page-type-landingpage">
  22.     #}
  23.     {{- parent() -}}{{ ' ' }}{{- bodyClasses|join(' ') -}}
  24. {%- endblock -%}
  25. {% block base_script_router %}
  26.     {{ parent() }}
  27.     <script>
  28.         window.activeRoute = {{ app.request.get('_route')|json_encode|raw }};
  29.         window.activeRouteParams = {{ app.request.attributes.get('_route_params')|json_encode|raw }};
  30.         window.router['frontend.samson.new-products'] = '{{ path('frontend.samson.new-products') }}';
  31.         window.router['frontend.samson.past-orders'] = '{{ path('frontend.samson.past-orders') }}';
  32.         window.router['frontend.samson.checkout.ajax.confirm'] = '{{ path('frontend.samson.checkout.ajax.confirm') }}';
  33.         window.router[ 'frontend.sales-channel.switcher' ] = '{{ path('frontend.sales-channel.switcher') }}';
  34.         window.router[ 'frontend.sales-channel.switch' ] = '{{ path('frontend.sales-channel.switch') }}';
  35.     </script>
  36.     {% if config("SamsonCustomer.config.select") %}
  37.         <script>
  38.             window.select2 = true;
  39.         </script>
  40.     {% else %}
  41.         <script>
  42.             window.select2 = false;
  43.         </script>
  44.     {% endif %}
  45. {% endblock %}
  46. {% block base_body_script %}
  47.     {{ parent() }}
  48.     <script src="{{ asset('bundles/samsoncustomer/static/js/samson-microsite.f4607ebec.js', 'asset') }}" type="text/javascript"></script>
  49. {% endblock %}
  50. {% block base_header %}
  51.     <div class="header header__cover"></div>
  52.     <header class="header header--main">
  53.         {% block base_header_inner %}
  54.             <div class="header__content container">
  55.                 {% sw_include '@Storefront/storefront/layout/header/header.html.twig' %}
  56.             </div>
  57.         {% endblock %}
  58.         {% block base_header_search %}
  59.             <div class="header__search">
  60.                 {% sw_include '@Storefront/storefront/layout/header/search.html.twig' %}
  61.             </div>
  62.         {% endblock %}
  63.     </header>
  64.     {% sw_include '@SamsonCustomer/storefront/component/newsletter-banner.html.twig' %}
  65. {% endblock %}
  66. {% block base_navigation %}
  67.     <div class="nav-main">
  68.         {% block base_navigation_inner %}
  69.             {% sw_include '@Storefront/storefront/layout/navigation/navigation.html.twig' %}
  70.         {% endblock %}
  71.     </div>
  72. {% endblock %}