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') %}
  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.                                     {% if breadcrumbList %}
  65.                                         {% sw_include '@Storefront/storefront/layout/breadcrumb.html.twig' %}
  66.                                     {% endif %}
  67.                                 {% endblock %}
  68.                                 {% block base_content %}{% endblock %}
  69.                             </div>
  70.                         {% endblock %}
  71.                     </div>
  72.                 {% endblock %}
  73.             </main>
  74.         {% endblock %}
  75.         {% block base_footer %}
  76.             <footer class="footer-main">
  77.                 {% block base_footer_inner %}
  78.                     <div class="container">
  79.                         {% sw_include '@Storefront/storefront/layout/footer/footer.html.twig' %}
  80.                     </div>
  81.                 {% endblock %}
  82.             </footer>
  83.         {% endblock %}
  84.     {% endblock %}
  85.     {% block base_scroll_up %}
  86.         {% sw_include '@Storefront/storefront/layout/scroll-up.html.twig' %}
  87.     {% endblock %}
  88.     {% block base_cookie_permission %}
  89.         {% sw_include '@Storefront/storefront/layout/cookie/cookie-permission.html.twig' %}
  90.     {% endblock %}
  91.     {% block base_pseudo_modal %}
  92.         {% sw_include '@Storefront/storefront/component/pseudo-modal.html.twig' %}
  93.     {% endblock %}
  94.     {% block base_body_script %}
  95.         {% block base_script_token %}
  96.             <script>
  97.                 {# @deprecated tag:v6.4.0 apiAccessUrl will be removed #}
  98.                 window.apiAccessUrl = "{{ url('frontend.api-access') }}";
  99.             </script>
  100.         {% endblock %}
  101.         {% block base_script_router %}
  102.             {# Register all routes that will be needed in JavaScript to the window.router object #}
  103.             <script>
  104.                 window.activeNavigationId = '{{ page.header.navigation.active.id }}';
  105.                 window.router = {
  106.                     'frontend.cart.offcanvas': '{{ path('frontend.cart.offcanvas') }}',
  107.                     'frontend.cookie.offcanvas': '{{ path('frontend.cookie.offcanvas') }}',
  108.                     'frontend.checkout.finish.page': '{{ path('frontend.checkout.finish.page') }}',
  109.                     'frontend.checkout.info': '{{ path('frontend.checkout.info') }}',
  110.                     'frontend.menu.offcanvas': '{{ path('frontend.menu.offcanvas') }}',
  111.                     'frontend.cms.page': '{{ path('frontend.cms.page') }}',
  112.                     'frontend.cms.navigation.page': '{{ path('frontend.cms.navigation.page') }}',
  113.                     'frontend.account.addressbook': '{{ path('frontend.account.addressbook') }}',
  114.                     'frontend.csrf.generateToken': '{{ path('frontend.csrf.generateToken') }}',
  115.                     'frontend.country.country-data': '{{ path('frontend.country.country.data') }}',
  116.                     'frontend.store-api.proxy': '{{ path('frontend.store-api.proxy') }}',
  117.                 };
  118.                 window.storeApiProxyToken = '{{ sw_csrf("frontend.store-api.proxy", {"mode": "token"}) }}';
  119.             </script>
  120.         {% endblock %}
  121.         {% block base_script_breakpoints %}
  122.             {# Register the available viewport breakpoints the window.breakpoints object #}
  123.             <script>
  124.                 window.breakpoints = {{ shopware.theme.breakpoint|json_encode()|raw }};
  125.             </script>
  126.         {% endblock %}
  127.         {% block base_script_csrf %}
  128.             <script>
  129.                 window.csrf = {
  130.                     'enabled': '{{ shopware.csrfEnabled }}',
  131.                     'mode': '{{ shopware.csrfMode }}'
  132.                 }
  133.             </script>
  134.         {% endblock %}
  135.         {% block base_script_hmr_mode %}
  136.             {% if isHMRMode %}
  137.                 {% set baseUrl = app.request.getScheme() ~ '://' ~ app.request.getHost() %}
  138.                 {% set port = app.request.headers.get('hot-reload-port') %}
  139.                 <script type="text/javascript" src="{{ baseUrl }}:{{ port }}/js/vendor-node.js"></script>
  140.                 <script type="text/javascript" src="{{ baseUrl }}:{{ port }}/js/vendor-shared.js"></script>
  141.                 <script type="text/javascript" src="{{ baseUrl }}:{{ port }}/js/runtime.js"></script>
  142.                 <script type="text/javascript" src="{{ baseUrl }}:{{ port }}/js/app.js"></script>
  143.                 {# The storefront entry is a combined entry point which contains all plugins & themes #}
  144.                 <script type="text/javascript" src="{{ baseUrl }}:{{ port }}/js/storefront.js"></script>
  145.             {% else %}
  146.                 {% for file in shopware.theme.assets.js %}
  147.                     <script type="text/javascript" src="{{ asset(file, 'theme') }}" async></script>
  148.                 {% endfor %}
  149.             {% endif %}
  150.         {% endblock %}
  151.     {% endblock %}
  152.     </body>
  153. {% endblock %}
  154. </html>