custom/plugins/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 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_meta_tags_opengraph %}
  12.     {% if activeRoute == 'frontend.blog.post' %}
  13.         <meta property="og:type"
  14.               content="website"/>
  15.         <meta property="og:site_name"
  16.               content="{{ basicConfig.shopName }}"/>
  17.         <meta property="og:title"
  18.               content="{{ post.translated.metatitle ? post.translated.metatitle : post.translated.title }}"/>
  19.         <meta property="og:description"
  20.               content="{{ post.translated.metadescription ? post.translated.metadescription : post.translated.teaser }}"/>
  21.         {% if(postThumb) %}
  22.             <meta property="og:image"
  23.                   content="{{ postThumb.getUrl() }}"/>
  24.         {% else %}
  25.             <meta property="og:image"
  26.                   content="{{ theme_config('sw-logo-desktop') }}"/>
  27.         {% endif %}
  28.         <meta name="twitter:card"
  29.               content="summary"/>
  30.         <meta name="twitter:site"
  31.               content="{{ basicConfig.shopName }}"/>
  32.         <meta name="twitter:title"
  33.               content="{{ post.translated.metatitle ? post.translated.metatitle : post.translated.title  }}"/>
  34.         <meta name="twitter:description"
  35.               content="{{ post.translated.metadescription ? post.translated.metadescription : post.translated.teaser }}"/>
  36.         {% if(postThumb) %}
  37.             <meta name="twitter:image"
  38.                   content="{{ postThumb.getUrl() }}"/>
  39.         {% else %}
  40.             <meta property="og:image"
  41.                   content="{{ theme_config('sw-logo-desktop') }}"/>
  42.         {% endif %}
  43.     {% else %}
  44.         {{ parent() }}
  45.     {% endif %}
  46. {% endblock %}
  47. {% block layout_head_meta_tags_schema_webpage %}
  48.     {{ parent() }}
  49.     {% if activeRoute == 'frontend.blog.post' %}
  50.         <script type="application/ld+json">
  51.             {
  52.                 "@context": "https://schema.org",
  53.                 "@type": "BlogPosting",
  54.                 "headline": "{{ post.translated.title }}",
  55.                 "url": "{{ seoUrl('frontend.blog.post', { postId: post.id }) }}",
  56.                 "datePublished": "{{ post.createdAt|date('Y-m-d') }}",
  57.                 "dateCreated": "{{ post.createdAt|date('Y-m-d') }}",
  58.                 "dateModified": "{{ post.updatedAt|date('Y-m-d') }}",
  59.                 "description": "{{ post.translated.teaser }}",
  60.                 {% if post.tags|length >0 %}"keywords": [
  61.                     {% for tag in post.tags %}"{{ tag.name }}"{% if not loop.last %}, {% endif %}{% endfor %}
  62.                 ],{% endif %}
  63.                 {% if postThumb %}"image": "{{ postThumb.getUrl() }}",{% endif %}
  64.                 {% if post.author %}
  65.                 "author": {
  66.                     "@type": "Person",
  67.                     "name": "{{ post.author.translated.name }}"
  68.                     {% if authorThumb %}, "image": "{{ authorThumb.getUrl() }}"{% endif %}
  69.                 },
  70.                 {% endif %}
  71.                 "publisher": {
  72.                     "@type": "Organization",
  73.                     "name": "{{ config('core.basicInformation.shopName') }}",
  74.                     "url": "{{ seoUrl('frontend.home.page') }}",
  75.                     "logo": {
  76.                         "@type": "ImageObject",
  77.                         "url": "{{ theme_config('sw-logo-desktop')|sw_encode_url }}"
  78.                     }
  79.                 }
  80.             }
  81.         </script>
  82.     {% endif %}
  83. {% endblock %}