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-{% 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.                         'frontend.csrf.generateToken': '{{ path('frontend.csrf.generateToken') }}',
  113.                         'frontend.country.country-data': '{{ path('frontend.country.country.data') }}',
  114.                         'frontend.store-api.proxy': '{{ path('frontend.store-api.proxy') }}',
  115.                     };
  116.                     window.storeApiProxyToken = '{{ sw_csrf("frontend.store-api.proxy", {"mode": "token"}) }}';
  117.                     window.salesChannelId = '{{ app.request.attributes.get('sw-sales-channel-id') }}';
  118.                 </script>
  119.             {% endblock %}
  120.             {# @deprecated tag:v6.5.0 - Will be moved to `layout/meta.html.twig` - Use block `layout_head_javascript_breakpoints` instead #}
  121.             {% block base_script_breakpoints %}
  122.                 {# Register the available viewport breakpoints the window.breakpoints object #}
  123.                 <script>
  124.                     {% set breakpoint = {
  125.                         'xs': theme_config('breakpoint.xs'),
  126.                         'sm': theme_config('breakpoint.sm'),
  127.                         'md': theme_config('breakpoint.md'),
  128.                         'lg': theme_config('breakpoint.lg'),
  129.                         'xl': theme_config('breakpoint.xl')
  130.                     } %}
  131.                     {# @deprecated tag:v6.5.0 - Bootstrap v5 adds xxl breakpoint #}
  132.                     {% if feature('v6.5.0.0') %}
  133.                         {% set breakpoint = breakpoint|merge({
  134.                             'xxl': theme_config('breakpoint.xxl')
  135.                         }) %}
  136.                     {% endif %}
  137.                     window.breakpoints = {{ breakpoint|json_encode()|raw }};
  138.                 </script>
  139.             {% endblock %}
  140.             {# @deprecated tag:v6.5.0 - Will be moved to `layout/meta.html.twig` - Use block `layout_head_javascript_csrf` instead #}
  141.             {% block base_script_csrf %}
  142.                 <script>
  143.                     window.csrf = {
  144.                         'enabled': '{{ shopware.csrfEnabled }}',
  145.                         'mode': '{{ shopware.csrfMode }}'
  146.                     }
  147.                 </script>
  148.             {% endblock %}
  149.             {% if config('core.cart.wishlistEnabled') %}
  150.                 {# @deprecated tag:v6.5.0 - Will be moved to `layout/meta.html.twig` - Use block `layout_head_javascript_wishlist_state` instead #}
  151.                 {% block base_script_wishlist_state %}
  152.                     <script>
  153.                         window.customerLoggedInState = {{ context.customer is not null and not context.customer.guest ? 1 : 0 }};
  154.                         window.wishlistEnabled = {{ config('core.cart.wishlistEnabled') }};
  155.                     </script>
  156.                 {% endblock %}
  157.             {% endif %}
  158.             {# @deprecated tag:v6.5.0 - Will be moved to `layout/meta.html.twig` - Use block `layout_head_javascript_jquery` instead #}
  159.             {% block base_script_jquery %}
  160.             {% endblock %}
  161.             {# @deprecated tag:v6.5.0 - Will be moved to `layout/meta.html.twig` - Use block `layout_head_javascript_hmr_mode` instead #}
  162.             {% block base_script_hmr_mode %}
  163.                 {% if isHMRMode %}
  164.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/vendor-node.js"></script>
  165.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/vendor-shared.js"></script>
  166.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/runtime.js"></script>
  167.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/app.js"></script>
  168.                     {# The storefront entry is a combined entry point which contains all plugins & themes #}
  169.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/storefront.js"></script>
  170.                 {% else %}
  171.                     {% for file in theme_config('assets.js') %}
  172.                         <script type="text/javascript" src="{{ asset(file, 'theme') }}"></script>
  173.                     {% endfor %}
  174.                 {% endif %}
  175.             {% endblock %}
  176.         {% endif %}
  177.     {% endblock %}
  178.     </body>
  179. {% endblock %}
  180. </html>