vendor/store.shopware.com/netzpblog6/src/Resources/views/storefront/layout/meta.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/layout/meta.html.twig' %}
  2. {% set postImage = post.imagePreview ?? post.image %}
  3. {% set postThumb = postImage.getThumbnails() ? postImage.getThumbnails()|sort((a, b) => a.getHeight() <=> b.getHeight())|last : postImage %}
  4. {% if postThumb == false %}{% set postThumb = postImage %}{% endif %}
  5. {% set authorThumb = post.author.image.getThumbnails() ? post.author.image.getThumbnails()|filter(t => (t.getHeight() <= 500))|first : null %}
  6. {% block layout_head_meta_tags_general %}
  7.     {{ parent() }}
  8.     <link rel="alternate"
  9.           type="application/rss+xml"
  10.           title="{{ "netzp.blog.feed.metatitle"|trans }}"
  11.           href="{{ app.request.get('sw-sales-channel-base-url') }}/blog.rss" />
  12. {% endblock %}
  13. {% block layout_head_meta_tags_opengraph %}
  14.     {% if activeRoute == 'frontend.blog.post' %}
  15.         <meta property="og:type"
  16.               content="website"/>
  17.         <meta property="og:site_name"
  18.               content="{{ basicConfig.shopName }}"/>
  19.         <meta property="og:title"
  20.               content="{{ post.translated.metatitle ? post.translated.metatitle : post.translated.title }}"/>
  21.         <meta property="og:description"
  22.               content="{{ post.translated.metadescription ? post.translated.metadescription : post.translated.teaser }}"/>
  23.         {% if(postThumb) %}
  24.             <meta property="og:image"
  25.                   content="{{ postThumb.getUrl() }}"/>
  26.         {% else %}
  27.             <meta property="og:image"
  28.                   content="{{ theme_config('sw-logo-desktop') }}"/>
  29.         {% endif %}
  30.         <meta name="twitter:card"
  31.               content="summary"/>
  32.         <meta name="twitter:site"
  33.               content="{{ basicConfig.shopName }}"/>
  34.         <meta name="twitter:title"
  35.               content="{{ post.translated.metatitle ? post.translated.metatitle : post.translated.title  }}"/>
  36.         <meta name="twitter:description"
  37.               content="{{ post.translated.metadescription ? post.translated.metadescription : post.translated.teaser }}"/>
  38.         {% if(postThumb) %}
  39.             <meta name="twitter:image"
  40.                   content="{{ postThumb.getUrl() }}"/>
  41.         {% else %}
  42.             <meta property="og:image"
  43.                   content="{{ theme_config('sw-logo-desktop') }}"/>
  44.         {% endif %}
  45.     {% else %}
  46.         {{ parent() }}
  47.     {% endif %}
  48. {% endblock %}
  49. {% block layout_head_meta_tags_schema_webpage %}
  50.     {{ parent() }}
  51.     {% if activeRoute == 'frontend.blog.post' %}
  52.         <script type="application/ld+json">
  53.             {
  54.                 "@context": "https://schema.org",
  55.                 "@type": "BlogPosting",
  56.                 "headline": "{{ post.translated.title }}",
  57.                 "url": "{{ seoUrl('frontend.blog.post', { postId: post.id }) }}",
  58.                 "datePublished": "{{ post.createdAt|date('Y-m-d') }}",
  59.                 "dateCreated": "{{ post.createdAt|date('Y-m-d') }}",
  60.                 "dateModified": "{{ post.updatedAt|date('Y-m-d') }}",
  61.                 "description": "{{ post.translated.teaser }}",
  62.                 {% if post.tags|length >0 %}"keywords": [
  63.                     {% for tag in post.tags %}"{{ tag.name }}"{% if not loop.last %}, {% endif %}{% endfor %}
  64.                 ],{% endif %}
  65.                 {% if postThumb %}"image": "{{ postThumb.getUrl() }}",{% endif %}
  66.                 {% if post.author %}
  67.                 "author": {
  68.                     "@type": "Person",
  69.                     "name": "{{ post.author.translated.name }}"
  70.                     {% if authorThumb %}, "image": "{{ authorThumb.getUrl() }}"{% endif %}
  71.                 },
  72.                 {% endif %}
  73.                 "publisher": {
  74.                     "@type": "Organization",
  75.                     "name": "{{ config('core.basicInformation.shopName') }}",
  76.                     "url": "{{ seoUrl('frontend.home.page') }}",
  77.                     "logo": {
  78.                         "@type": "ImageObject",
  79.                         "url": "{{ theme_config('sw-logo-desktop')|sw_encode_url }}"
  80.                     }
  81.                 }
  82.             }
  83.         </script>
  84.     {% endif %}
  85. {% endblock %}