vendor/shopware/storefront/Resources/views/storefront/layout/meta.html.twig line 1

Open in your IDE?
  1. {% block layout_head_inner %}
  2.     {% set metaInformation = page.metaInformation %}
  3.     {% set basicConfig = config('core.basicInformation') %}
  4.     {% set maxLength = config('seo.descriptionMaxLength') %}
  5.     {% set metaDescription = metaInformation.metaDescription|striptags|trim|u.truncate(maxLength ?? 255, '…') %}
  6.     {% set metaTitle = metaInformation.metaTitle|striptags|trim %}
  7.     {% set metaKeywords = metaInformation.metaKeywords|striptags|trim %}
  8.     <head>
  9.         {% block layout_head_meta_tags %}
  10.             {% block layout_head_meta_tags_charset %}
  11.                 <meta charset="utf-8">
  12.             {% endblock %}
  13.             {% block layout_head_meta_tags_viewport %}
  14.                 <meta name="viewport"
  15.                       content="width=device-width, initial-scale=1, shrink-to-fit=no">
  16.             {% endblock %}
  17.             {% block layout_head_meta_tags_general %}
  18.                 <meta name="author"
  19.                       content="{% block layout_head_meta_tags_general_author %}{{ metaInformation.author|striptags }}{% endblock %}"/>
  20.                 <meta name="robots"
  21.                       content="{% block layout_head_meta_tags_robots %}{{ metaInformation.robots }}{% endblock %}"/>
  22.                 <meta name="revisit-after"
  23.                       content="{% block layout_head_meta_tags_general_revisit %}{{ metaInformation.revisit|striptags }}{% endblock %}"/>
  24.                 <meta name="keywords"
  25.                       content="{% block layout_head_meta_tags_keywords %}{{ metaKeywords }}{% endblock %}"/>
  26.                 <meta name="description"
  27.                       content="{% block layout_head_meta_tags_description %}{{ metaDescription }}{% endblock %}"/>
  28.             {% endblock %}
  29.             {% block layout_head_meta_tags_opengraph %}
  30.                 <meta property="og:url"
  31.                       content="{% block layout_head_meta_tags_url_og %}{{ (page.metaInformation.canonical is defined) ? page.metaInformation.canonical : app.request.uri }}{% endblock %}"/>
  32.                 <meta property="og:type"
  33.                       content="{% block layout_head_meta_tags_type_og %}website{% endblock %}"/>
  34.                 <meta property="og:site_name"
  35.                       content="{% block layout_head_meta_tags_sitename_og %}{{ basicConfig.shopName }}{% endblock %}"/>
  36.                 <meta property="og:title"
  37.                       content="{% block layout_head_meta_tags_title_og %}{{ metaTitle }}{% endblock %}"/>
  38.                 <meta property="og:description"
  39.                       content="{% block layout_head_meta_tags_description_og %}{{ metaDescription }}{% endblock %}"/>
  40.                 <meta property="og:image"
  41.                       content="{% block layout_head_meta_tags_image_og %}{{ theme_config('sw-logo-desktop') }}{% endblock %}"/>
  42.                 <meta name="twitter:card"
  43.                       content="{% block layout_head_meta_tags_card_twitter %}summary{% endblock %}"/>
  44.                 <meta name="twitter:site"
  45.                       content="{% block layout_head_meta_tags_sitename_twitter %}{{ basicConfig.shopName }}{% endblock %}"/>
  46.                 <meta name="twitter:title"
  47.                       content="{% block layout_head_meta_tags_title_twitter %}{{ metaTitle }}{% endblock %}"/>
  48.                 <meta name="twitter:description"
  49.                       content="{% block layout_head_meta_tags_description_twitter %}{{ metaDescription }}{% endblock %}"/>
  50.                 <meta name="twitter:image"
  51.                       content="{% block layout_head_meta_tags_image_twitter %}{{ theme_config('sw-logo-desktop') }}{% endblock %}"/>
  52.             {% endblock %}
  53.             {% block layout_head_meta_tags_schema_webpage %}
  54.                 <meta itemprop="copyrightHolder"
  55.                       content="{% block layout_head_meta_tags_copyright_holder %}{{ basicConfig.shopName }}{% endblock %}"/>
  56.                 <meta itemprop="copyrightYear"
  57.                       content="{% block layout_head_meta_tags_copyright_year %}{{ metaInformation.copyrightYear|striptags }}{% endblock %}"/>
  58.                 <meta itemprop="isFamilyFriendly"
  59.                       content="{% block layout_head_meta_tags_family_friendly %}{% if basicConfig.familyFriendly %}true{% else %}false{% endif %}{% endblock %}"/>
  60.                 <meta itemprop="image"
  61.                       content="{% block layout_head_meta_tags_image_meta %}{{ theme_config('sw-logo-desktop') }}{% endblock %}"/>
  62.             {% endblock %}
  63.             {% block layout_head_meta_tags_hreflangs %}
  64.                 {% for link in hrefLang %}
  65.                     <link rel="alternate" hreflang="{{ link.locale }}" href="{{ link.url }}" />
  66.                 {% endfor %}
  67.             {% endblock %}
  68.         {% endblock %}
  69.         {% block layout_head_favicon %}
  70.             <link rel="shortcut icon"
  71.                   href="{{ theme_config('sw-logo-favicon') }}">
  72.         {% endblock %}
  73.         {% block layout_head_apple %}
  74.             {% if theme_config('sw-logo-share') %}
  75.             <link rel="apple-touch-icon"
  76.                   sizes="180x180"
  77.                   href="{{ theme_config('sw-logo-share') }}">
  78.             {% endif %}
  79.         {% endblock %}
  80.         {% block layout_head_android %}
  81.             {# @deprecated tag:v6.5.0 - Use the block above, "layout_head_apple", instead #}
  82.         {% endblock %}
  83.         {% block layout_head_canonical %}
  84.             {% if page.metaInformation.canonical %}
  85.                 <link rel="canonical" href="{{ page.metaInformation.canonical }}" />
  86.             {% endif %}
  87.         {% endblock %}
  88.         {% block layout_head_title %}
  89.             <title itemprop="name">{% apply spaceless %}
  90.                 {% block layout_head_title_inner %}
  91.                     {{ metaTitle }}
  92.                 {% endblock %}
  93.             {% endapply %}</title>
  94.         {% endblock %}
  95.         {% block layout_head_stylesheet %}
  96.             {% if isHMRMode %}
  97.                 {# CSS will be loaded from the JS automatically #}
  98.             {% else %}
  99.                 {% set assets = theme_config('assets.css') %}
  100.                 {% for file in assets %}
  101.                     <link rel="stylesheet"
  102.                       href="{{ asset(file, 'theme') }}">
  103.                 {% endfor %}
  104.             {% endif %}
  105.         {% endblock %}
  106.         {% block layout_head_javascript_feature %}
  107.             {% sw_include "@Storefront/storefront/component/feature.html.twig" %}
  108.         {% endblock %}
  109.         {# Block for tracking scripts which are required to include in the `head` section of the document #}
  110.         {% block layout_head_javascript_tracking %}
  111.             {% sw_include "@Storefront/storefront/component/analytics.html.twig" %}
  112.         {% endblock %}
  113.         {% block layout_head_javascript_recaptcha %}
  114.             {% sw_include "@Storefront/storefront/component/recaptcha.html.twig" %}
  115.         {% endblock %}
  116.         {% block layout_head_javascript_token %}
  117.         {% endblock %}
  118.         {% if config('core.basicInformation.useDefaultCookieConsent') %}
  119.             {% block layout_head_javascript_cookie_state %}
  120.                 <script>
  121.                     window.useDefaultCookieConsent = true;
  122.                 </script>
  123.             {% endblock %}
  124.         {% endif %}
  125.         {% if feature('FEATURE_NEXT_15917') %}
  126.             {% block layout_head_javascript_router %}
  127.                 {# Register all routes that will be needed in JavaScript to the window.router object #}
  128.                 <script>
  129.                     window.activeNavigationId = '{{ page.header.navigation.active.id }}';
  130.                     window.router = {
  131.                         'frontend.cart.offcanvas': '{{ path('frontend.cart.offcanvas') }}',
  132.                         'frontend.cookie.offcanvas': '{{ path('frontend.cookie.offcanvas') }}',
  133.                         'frontend.checkout.finish.page': '{{ path('frontend.checkout.finish.page') }}',
  134.                         'frontend.checkout.info': '{{ path('frontend.checkout.info') }}',
  135.                         'frontend.menu.offcanvas': '{{ path('frontend.menu.offcanvas') }}',
  136.                         'frontend.cms.page': '{{ path('frontend.cms.page') }}',
  137.                         'frontend.cms.navigation.page': '{{ path('frontend.cms.navigation.page') }}',
  138.                         'frontend.account.addressbook': '{{ path('frontend.account.addressbook') }}',
  139.                         'frontend.csrf.generateToken': '{{ path('frontend.csrf.generateToken') }}',
  140.                         'frontend.country.country-data': '{{ path('frontend.country.country.data') }}',
  141.                         'frontend.store-api.proxy': '{{ path('frontend.store-api.proxy') }}',
  142.                     };
  143.                     window.storeApiProxyToken = '{{ sw_csrf("frontend.store-api.proxy", {"mode": "token"}) }}';
  144.                     window.salesChannelId = '{{ app.request.attributes.get('sw-sales-channel-id') }}';
  145.                 </script>
  146.             {% endblock %}
  147.             {% block layout_head_javascript_breakpoints %}
  148.                 {# Register the available viewport breakpoints the window.breakpoints object #}
  149.                 <script>
  150.                     {% set breakpoint = {
  151.                         'xs': theme_config('breakpoint.xs'),
  152.                         'sm': theme_config('breakpoint.sm'),
  153.                         'md': theme_config('breakpoint.md'),
  154.                         'lg': theme_config('breakpoint.lg'),
  155.                         'xl': theme_config('breakpoint.xl')
  156.                     } %}
  157.                     window.breakpoints = {{ breakpoint|json_encode()|raw }};
  158.                 </script>
  159.             {% endblock %}
  160.             {% block layout_head_javascript_csrf %}
  161.                 <script>
  162.                     window.csrf = {
  163.                         'enabled': '{{ shopware.csrfEnabled }}',
  164.                         'mode': '{{ shopware.csrfMode }}'
  165.                     }
  166.                 </script>
  167.             {% endblock %}
  168.             {% if config('core.cart.wishlistEnabled') %}
  169.                 {% block layout_head_javascript_wishlist_state %}
  170.                     <script>
  171.                         window.customerLoggedInState = {{ context.customer is not null and not context.customer.guest ? 1 : 0 }};
  172.                         window.wishlistEnabled = {{ config('core.cart.wishlistEnabled') }};
  173.                     </script>
  174.                 {% endblock %}
  175.             {% endif %}
  176.             {# @internal tag:v6.5.0 - jQuery will be removed from the core. This block can be used to add jQuery as a `<script>`. #}
  177.             {% block layout_head_javascript_jquery %}
  178.             {% endblock %}
  179.             {% block layout_head_javascript_hmr_mode %}
  180.                 {% if isHMRMode %}
  181.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/vendor-node.js" defer></script>
  182.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/vendor-shared.js" defer></script>
  183.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/runtime.js" defer></script>
  184.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/app.js" defer></script>
  185.                     {# The storefront entry is a combined entry point which contains all plugins & themes #}
  186.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/storefront.js" defer></script>
  187.                 {% else %}
  188.                     {% for file in theme_config('assets.js') %}
  189.                         <script type="text/javascript" src="{{ asset(file, 'theme') }}" defer></script>
  190.                     {% endfor %}
  191.                 {% endif %}
  192.             {% endblock %}
  193.         {% endif %}
  194.     </head>
  195. {% endblock %}