vendor/shopware/storefront/Resources/views/storefront/base.html.twig line 1

Open in your IDE?
  1. {# Set variable to "true" to enable HMR (hot page reloading) mode #}
  2. {% set isHMRMode = app.request.headers.get('hot-reload-mode') and app.environment == 'dev' %}
  3. {% block base_doctype %}
  4. <!DOCTYPE html>
  5. {% endblock %}
  6. {% block base_html %}
  7. <html lang="{{ page.header.activeLanguage.translationCode.code }}"
  8.       itemscope="itemscope"
  9.       itemtype="https://schema.org/WebPage">
  10. {% endblock %}
  11. {% block base_head %}
  12.     {% sw_include '@Storefront/storefront/layout/meta.html.twig' %}
  13. {% endblock %}
  14. {% block base_body %}
  15.     <body class="{% block base_body_classes %}is-ctl-{% if controllerName is not empty %}{{ controllerName|lower }}{% endif %} is-act-{% if controllerAction is not empty %}{{ controllerAction|lower }}{% endif %}{% endblock %}">
  16.     {% block base_body_inner %}
  17.         {% block base_noscript %}
  18.             <noscript class="noscript-main">
  19.                 {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
  20.                     type: 'info',
  21.                     content: 'general.noscriptNotice'|trans|sw_sanitize
  22.                 } %}
  23.             </noscript>
  24.         {% endblock %}
  25.         {% block base_header %}
  26.             <header class="header-main">
  27.                 {% block base_header_inner %}
  28.                     <div class="container">
  29.                         {% sw_include '@Storefront/storefront/layout/header/header.html.twig' %}
  30.                     </div>
  31.                 {% endblock %}
  32.             </header>
  33.         {% endblock %}
  34.         {% block base_navigation %}
  35.             <div class="nav-main">
  36.                 {% block base_navigation_inner %}
  37.                     {% sw_include '@Storefront/storefront/layout/navigation/navigation.html.twig' %}
  38.                 {% endblock %}
  39.             </div>
  40.         {% endblock %}
  41.         {% block base_offcanvas_navigation %}
  42.             {% if page.header.navigation %}
  43.                 <div class="d-none js-navigation-offcanvas-initial-content{% if context.salesChannel.navigationCategoryId == page.header.navigation.active.id %} is-root{% endif %}">
  44.                     {% block base_offcanvas_navigation_inner %}
  45.                         {% sw_include '@Storefront/storefront/layout/navigation/offcanvas/navigation.html.twig' with { navigation: page.header.navigation } %}
  46.                     {% endblock %}
  47.                 </div>
  48.             {% endif %}
  49.         {% endblock %}
  50.         {% block base_main %}
  51.             <main class="content-main">
  52.                 {% block base_flashbags %}
  53.                     <div class="flashbags container">
  54.                         {% for type, messages in app.flashes %}
  55.                             {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with { type: type, list: messages } %}
  56.                         {% endfor %}
  57.                     </div>
  58.                 {% endblock %}
  59.                 {% block base_main_inner %}
  60.                     <div class="container">
  61.                         {% block base_main_container %}
  62.                             <div class="container-main">
  63.                                 {% block base_breadcrumb %}
  64.                                     {% sw_include '@Storefront/storefront/layout/breadcrumb.html.twig' with {
  65.                                         context: context,
  66.                                         category: page.product.seoCategory
  67.                                     } only %}
  68.                                 {% endblock %}
  69.                                 {% block base_content %}{% endblock %}
  70.                             </div>
  71.                         {% endblock %}
  72.                     </div>
  73.                 {% endblock %}
  74.             </main>
  75.         {% endblock %}
  76.         {% block base_footer %}
  77.             <footer class="footer-main">
  78.                 {% block base_footer_inner %}
  79.                     {% sw_include '@Storefront/storefront/layout/footer/footer.html.twig' %}
  80.                 {% endblock %}
  81.             </footer>
  82.         {% endblock %}
  83.     {% endblock %}
  84.     {% block base_scroll_up %}
  85.         {% sw_include '@Storefront/storefront/layout/scroll-up.html.twig' %}
  86.     {% endblock %}
  87.     {% block base_cookie_permission %}
  88.         {% sw_include '@Storefront/storefront/layout/cookie/cookie-permission.html.twig' %}
  89.     {% endblock %}
  90.     {% block base_pseudo_modal %}
  91.         {% sw_include '@Storefront/storefront/component/pseudo-modal.html.twig' %}
  92.     {% endblock %}
  93.     {% block base_body_script %}
  94.         {% if not feature('FEATURE_NEXT_15917') %}
  95.             {# @deprecated tag:v6.5.0 - Will be moved to `layout/meta.html.twig` - Use block `layout_head_javascript_token` instead #}
  96.             {% block base_script_token %}
  97.             {% endblock %}
  98.             {# @deprecated tag:v6.5.0 - Will be moved to `layout/meta.html.twig` - Use block `layout_head_javascript_router` instead #}
  99.             {% block base_script_router %}
  100.                 {# Register all routes that will be needed in JavaScript to the window.router object #}
  101.                 <script>
  102.                     window.activeNavigationId = '{{ page.header.navigation.active.id }}';
  103.                     window.router = {
  104.                         'frontend.cart.offcanvas': '{{ path('frontend.cart.offcanvas') }}',
  105.                         'frontend.cookie.offcanvas': '{{ path('frontend.cookie.offcanvas') }}',
  106.                         'frontend.checkout.finish.page': '{{ path('frontend.checkout.finish.page') }}',
  107.                         'frontend.checkout.info': '{{ path('frontend.checkout.info') }}',
  108.                         'frontend.menu.offcanvas': '{{ path('frontend.menu.offcanvas') }}',
  109.                         'frontend.cms.page': '{{ path('frontend.cms.page') }}',
  110.                         'frontend.cms.navigation.page': '{{ path('frontend.cms.navigation.page') }}',
  111.                         'frontend.account.addressbook': '{{ path('frontend.account.addressbook') }}',
  112.                         {# @deprecated tag:v6.5.0 - Route frontend.csrf.generateToken will be removed. #}
  113.                         'frontend.csrf.generateToken': '{{ path('frontend.csrf.generateToken') }}',
  114.                         'frontend.country.country-data': '{{ path('frontend.country.country.data') }}',
  115.                         'frontend.store-api.proxy': '{{ path('frontend.store-api.proxy') }}',
  116.                     };
  117.                     {# @deprecated tag:v6.5.0 - storeApiProxyToken will be removed. #}
  118.                     window.storeApiProxyToken = '{{ sw_csrf("frontend.store-api.proxy", {"mode": "token"}) }}';
  119.                     window.salesChannelId = '{{ app.request.attributes.get('sw-sales-channel-id') }}';
  120.                 </script>
  121.             {% endblock %}
  122.             {# @deprecated tag:v6.5.0 - Will be moved to `layout/meta.html.twig` - Use block `layout_head_javascript_breakpoints` instead #}
  123.             {% block base_script_breakpoints %}
  124.                 {# Register the available viewport breakpoints the window.breakpoints object #}
  125.                 <script>
  126.                     {% set breakpoint = {
  127.                         'xs': theme_config('breakpoint.xs'),
  128.                         'sm': theme_config('breakpoint.sm'),
  129.                         'md': theme_config('breakpoint.md'),
  130.                         'lg': theme_config('breakpoint.lg'),
  131.                         'xl': theme_config('breakpoint.xl')
  132.                     } %}
  133.                     {# @deprecated tag:v6.5.0 - Bootstrap v5 adds xxl breakpoint #}
  134.                     {% if feature('v6.5.0.0') %}
  135.                         {% set breakpoint = breakpoint|merge({
  136.                             'xxl': theme_config('breakpoint.xxl')
  137.                         }) %}
  138.                     {% endif %}
  139.                     window.breakpoints = {{ breakpoint|json_encode()|raw }};
  140.                 </script>
  141.             {% endblock %}
  142.             {# @deprecated tag:v6.5.0 - Will be moved to `layout/meta.html.twig` - Use block `layout_head_javascript_csrf` instead #}
  143.             {% block base_script_csrf %}
  144.                 <script>
  145.                     window.csrf = {
  146.                         'enabled': '{{ shopware.csrfEnabled }}',
  147.                         'mode': '{{ shopware.csrfMode }}'
  148.                     }
  149.                 </script>
  150.             {% endblock %}
  151.             {% if config('core.cart.wishlistEnabled') %}
  152.                 {# @deprecated tag:v6.5.0 - Will be moved to `layout/meta.html.twig` - Use block `layout_head_javascript_wishlist_state` instead #}
  153.                 {% block base_script_wishlist_state %}
  154.                     <script>
  155.                         window.customerLoggedInState = {{ context.customer is not null and not context.customer.guest ? 1 : 0 }};
  156.                         window.wishlistEnabled = {{ config('core.cart.wishlistEnabled') }};
  157.                     </script>
  158.                 {% endblock %}
  159.             {% endif %}
  160.             {# @deprecated tag:v6.5.0 - Will be moved to `layout/meta.html.twig` - Use block `layout_head_javascript_jquery` instead #}
  161.             {% block base_script_jquery %}
  162.             {% endblock %}
  163.             {# @deprecated tag:v6.5.0 - Will be moved to `layout/meta.html.twig` - Use block `layout_head_javascript_hmr_mode` instead #}
  164.             {% block base_script_hmr_mode %}
  165.                 {% if isHMRMode %}
  166.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/vendor-node.js"></script>
  167.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/vendor-shared.js"></script>
  168.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/runtime.js"></script>
  169.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/app.js"></script>
  170.                     {# The storefront entry is a combined entry point which contains all plugins & themes #}
  171.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/storefront.js"></script>
  172.                 {% else %}
  173.                     {% for file in theme_config('assets.js') %}
  174.                         <script type="text/javascript" src="{{ asset(file, 'theme') }}"></script>
  175.                     {% endfor %}
  176.                 {% endif %}
  177.             {% endblock %}
  178.         {% endif %}
  179.     {% endblock %}
  180.     </body>
  181. {% endblock %}
  182. </html>