vendor/shopware/platform/src/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="{{ app.request.locale }}"
  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-{{ controllerName|lower }} is-act-{{ controllerAction|lower }}{% 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">
  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.         {% block base_script_token %}
  95.         {% endblock %}
  96.         {% block base_script_router %}
  97.             {# Register all routes that will be needed in JavaScript to the window.router object #}
  98.             <script>
  99.                 window.activeNavigationId = '{{ page.header.navigation.active.id }}';
  100.                 window.router = {
  101.                     'frontend.cart.offcanvas': '{{ path('frontend.cart.offcanvas') }}',
  102.                     'frontend.cookie.offcanvas': '{{ path('frontend.cookie.offcanvas') }}',
  103.                     'frontend.checkout.finish.page': '{{ path('frontend.checkout.finish.page') }}',
  104.                     'frontend.checkout.info': '{{ path('frontend.checkout.info') }}',
  105.                     'frontend.menu.offcanvas': '{{ path('frontend.menu.offcanvas') }}',
  106.                     'frontend.cms.page': '{{ path('frontend.cms.page') }}',
  107.                     'frontend.cms.navigation.page': '{{ path('frontend.cms.navigation.page') }}',
  108.                     'frontend.account.addressbook': '{{ path('frontend.account.addressbook') }}',
  109.                     'frontend.csrf.generateToken': '{{ path('frontend.csrf.generateToken') }}',
  110.                     'frontend.country.country-data': '{{ path('frontend.country.country.data') }}',
  111.                     'frontend.store-api.proxy': '{{ path('frontend.store-api.proxy') }}',
  112.                 };
  113.                 window.storeApiProxyToken = '{{ sw_csrf("frontend.store-api.proxy", {"mode": "token"}) }}';
  114.                 window.salesChannelId = '{{ app.request.attributes.get('sw-sales-channel-id') }}';
  115.             </script>
  116.         {% endblock %}
  117.         {% block base_script_breakpoints %}
  118.             {# Register the available viewport breakpoints the window.breakpoints object #}
  119.             <script>
  120.                 {% set breakpoint = {
  121.                     'xs': theme_config('breakpoint.sm'),
  122.                     'sm': theme_config('breakpoint.md'),
  123.                     'md': theme_config('breakpoint.lg'),
  124.                     'lg': theme_config('breakpoint.xl')
  125.                 } %}
  126.                 window.breakpoints = {{ breakpoint|json_encode()|raw }};
  127.             </script>
  128.         {% endblock %}
  129.         {% block base_script_csrf %}
  130.             <script>
  131.                 window.csrf = {
  132.                     'enabled': '{{ shopware.csrfEnabled }}',
  133.                     'mode': '{{ shopware.csrfMode }}'
  134.                 }
  135.             </script>
  136.         {% endblock %}
  137.         {% if config('core.cart.wishlistEnabled') %}
  138.             {% block base_script_wishlist_state %}
  139.                 <script>
  140.                     window.customerLoggedInState = {{ context.customer is not null and not context.customer.guest ? 1 : 0 }};
  141.                     window.wishlistEnabled = {{ config('core.cart.wishlistEnabled') }};
  142.                 </script>
  143.             {% endblock %}
  144.         {% endif %}
  145.         {% block base_script_hmr_mode %}
  146.             {% if isHMRMode %}
  147.                 <script type="text/javascript" src="/_webpack_hot_proxy_/js/vendor-node.js"></script>
  148.                 <script type="text/javascript" src="/_webpack_hot_proxy_/js/vendor-shared.js"></script>
  149.                 <script type="text/javascript" src="/_webpack_hot_proxy_/js/runtime.js"></script>
  150.                 <script type="text/javascript" src="/_webpack_hot_proxy_/js/app.js"></script>
  151.                 {# The storefront entry is a combined entry point which contains all plugins & themes #}
  152.                 <script type="text/javascript" src="/_webpack_hot_proxy_/js/storefront.js"></script>
  153.             {% else %}
  154.                 {% for file in theme_config('assets.js') %}
  155.                     <script type="text/javascript" src="{{ asset(file, 'theme') }}" async></script>
  156.                 {% endfor %}
  157.             {% endif %}
  158.         {% endblock %}
  159.     {% endblock %}
  160.     </body>
  161. {% endblock %}
  162. </html>