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