custom/plugins/DreiscSeoPro/src/Resources/views/storefront/layout/meta.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/layout/meta.html.twig' %}
  2. {# Rich Snippts #}
  3. {% block layout_head_meta_tags %}
  4.     {# Call the parent #}
  5.     {{ parent() }}
  6.     {# Output of the rich snippets #}
  7.     {% block dreisc_seo__layout_head_meta_tags__ld_json %}
  8.     {% set richSnippetDataStruct = page.extensions[constant('DreiscSeoPro\\Subscriber\\Installment\\RichSnippet\\RichSnippetSubscriber::DREISC_SEO_INSTALLMENT_RICH_SNIPPET_DATA')] %}
  9.     {% if richSnippetDataStruct is not null %}
  10.         {# <script type="application/ld+json">
  11.             {{ richSnippetDataStruct.ldJson|json_encode|raw }}
  12.         </script>
  13.         #}
  14.     {% endif %}
  15.     {% endblock %}
  16. {% endblock %}
  17. {# Social media #}
  18. {% block layout_head_meta_tags_opengraph %}
  19.     {# Fecth social media data #}
  20.     {% set socialMediaDataStruct = page.extensions[constant('DreiscSeoPro\\Subscriber\\Installment\\SocialMedia\\SocialMediaSubscriber::DREISC_SEO_INSTALLMENT_SOCIAL_MEDIA_DATA')] %}
  21.     {% if null == socialMediaDataStruct %}
  22.         {# Call the parent #}
  23.         {{ parent() }}
  24.     {% else %}
  25.         {% block dreisc_seo__layout_head_meta_tags_opengraph__og_type %}
  26.             <meta property="og:type" content="website"/>
  27.         {% endblock %}
  28.         {% block dreisc_seo__layout_head_meta_tags_opengraph__og_site_name %}
  29.             <meta property="og:site_name" content="{{ basicConfig.shopName }}"/>
  30.         {% endblock %}
  31.         {% block dreisc_seo__layout_head_meta_tags_opengraph__og_url%}
  32.             <meta property="og:url" content="{% block layout_head_meta_tags_url_og %}{{ (page.metaInformation.canonical is defined) ? page.metaInformation.canonical : app.request.uri }}{% endblock %}"/>
  33.         {% endblock %}
  34.         {% block dreisc_seo__layout_head_meta_tags_opengraph__og_title %}
  35.             {% if socialMediaDataStruct.facebookTitle is not empty %}
  36.                 <meta property="og:title" content="{{ socialMediaDataStruct.facebookTitle }}"/>
  37.             {% else %}
  38.                 <meta property="og:title" content="{{ metaTitle }}"/>
  39.             {% endif %}
  40.         {% endblock %}
  41.         {% block dreisc_seo__layout_head_meta_tags_opengraph__og_description %}
  42.             {% if socialMediaDataStruct.facebookDescription is not empty %}
  43.                 <meta property="og:description" content="{{ socialMediaDataStruct.facebookDescription }}"/>
  44.             {% else %}
  45.                 <meta property="og:description" content="{{ metaDescription }}"/>
  46.             {% endif %}
  47.         {% endblock %}
  48.         {% block dreisc_seo__layout_head_meta_tags_opengraph__og_image %}
  49.             {% if socialMediaDataStruct.facebookImage is not empty %}
  50.                 <meta property="og:image" content="{{ socialMediaDataStruct.facebookImage }}"/>
  51.             {% else %}
  52.                 <meta property="og:image" content="{{ theme_config('sw-logo-desktop') }}"/>
  53.             {% endif %}
  54.         {% endblock %}
  55.         {% block dreisc_seo__layout_head_meta_tags_twitter__card %}
  56.             <meta name="twitter:card" content="website"/>
  57.         {% endblock %}
  58.         {% block dreisc_seo__layout_head_meta_tags_twitter__site %}
  59.             <meta name="twitter:site" content="{{ config('core.basicInformation.shopName') }}"/>
  60.         {% endblock %}
  61.         {% block dreisc_seo__layout_head_meta_tags_twitter__title %}
  62.             {% if socialMediaDataStruct.twitterTitle is not empty %}
  63.                 <meta property="twitter:title" content="{{ socialMediaDataStruct.twitterTitle }}"/>
  64.             {% else %}
  65.                 <meta property="twitter:title" content="{{ metaTitle }}"/>
  66.             {% endif %}
  67.         {% endblock %}
  68.         {% block dreisc_seo__layout_head_meta_tags_twitter__description %}
  69.             {% if socialMediaDataStruct.twitterDescription is not empty %}
  70.                 <meta property="twitter:description" content="{{ socialMediaDataStruct.twitterDescription }}"/>
  71.             {% else %}
  72.                 <meta property="twitter:description" content="{{ metaDescription }}"/>
  73.             {% endif %}
  74.         {% endblock %}
  75.         {% block dreisc_seo__layout_head_meta_tags_twitter__image %}
  76.             {% if socialMediaDataStruct.twitterImage is not empty %}
  77.                 <meta property="twitter:image" content="{{ socialMediaDataStruct.twitterImage }}"/>
  78.             {% else %}
  79.                 <meta property="twitter:image" content="{{ theme_config('sw-logo-desktop') }}"/>
  80.             {% endif %}
  81.         {% endblock %}
  82.     {% endif %}
  83. {% endblock %}
  84. {# Robots tag #}
  85. {% block layout_head_meta_tags_robots %}{% apply spaceless %}
  86.     {# Check for a robots tag #}
  87.     {% set robotsTagDataStruct = page.extensions[constant('DreiscSeoPro\\Subscriber\\Installment\\RobotsTag\\RobotsTagSubscriber::DREISC_SEO_INSTALLMENT_ROBOTS_TAG_DATA')] %}
  88.     {# Check for fallback #}
  89.     {% if null == robotsTagDataStruct or robotsTagDataStruct.robotsTag is empty %}
  90.         {# Call the parent #}
  91.         {{ parent() }}
  92.     {% else %}
  93.         {% block dreisc_seo__layout_head_meta_tags_robots %}
  94.             {{ robotsTagDataStruct.robotsTag }}
  95.         {% endblock %}
  96.     {% endif %}
  97. {% endapply %}{% endblock %}
  98. {#
  99.     ** Canonical Link **
  100.     In shopware standard there is no canonical link on category pages / home page
  101.     @see https://issues.shopware.com/issues/NEXT-8662
  102. #}
  103. {% block layout_head_canonical %}{% apply spaceless %}
  104.     {# Check for the base information #}
  105.     {% set baseInformationDataStruct = page.extensions[constant('DreiscSeoPro\\Subscriber\\Installment\\BaseInformation\\BaseInformationSubscriber::DREISC_SEO_INSTALLMENT_BASE_INFORMATION_DATA')] %}
  106.     {% set canonicalDataStruct = page.extensions[constant('DreiscSeoPro\\Subscriber\\Installment\\Canonical\\CanonicalSubscriber::DREISC_SEO_INSTALLMENT_CANONICAL_DATA')] %}
  107.     {% block dreisc_seo__layout_head_canonical %}
  108.     {% if null != canonicalDataStruct and canonicalDataStruct.canonicalLink is not empty %}
  109.         {% block dreisc_seo__layout_head_canonical__individual %}
  110.             <link rel="canonical" href="{{ canonicalDataStruct.canonicalLink }}" />
  111.         {% endblock %}
  112.     {% elseif 'frontend.home.page' == activeRoute %}
  113.         {% block dreisc_seo__layout_head_canonical__home %}
  114.         <link rel="canonical" href="{{ seoUrl('frontend.home.page', {  }) }}" />
  115.         {% endblock %}
  116.     {% elseif 'frontend.navigation.page' == activeRoute and null != baseInformationDataStruct %}
  117.         {% block dreisc_seo__layout_head_canonical__navigation %}
  118.         <link rel="canonical" href="{{ seoUrl('frontend.navigation.page', { navigationId: baseInformationDataStruct.navigationId }) }}{% if app.request.query.get('p') %}?p={{ app.request.query.get('p') }}{% endif %}" />
  119.         {% endblock %}
  120.     {% endif %}
  121.     {% endblock %}
  122. {% endapply %}{% endblock %}