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