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

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