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

  1. {% sw_extends '@Storefront/storefront/layout/meta.html.twig' %}
  2. {% set entry = page.blogEntry %}
  3. {% if activeRoute == 'sas.frontend.blog.detail' and entry.media.url %}
  4.     {% set metaImage = entry.media.url|striptags|trim %}
  5. {% endif %}
  6. {% block layout_head_meta_tags %}
  7.     {% if activeRoute == 'sas.frontend.blog.detail' %}
  8.         <link rel="canonical" href="{{ seoUrl('sas.frontend.blog.detail', { articleId: entry.id }) }}"/>
  9.     {% endif %}
  10.     {{ parent() }}
  11. {% endblock %}
  12. {% block layout_head_meta_tags_image_og %}{{ metaImage ?? parent() }}{% endblock %}
  13. {% block layout_head_meta_tags_image_twitter %}{{ metaImage ?? parent() }}{% endblock %}
  14. {% block layout_head_meta_tags_image_meta %}{{ metaImage ?? parent() }}{% endblock %}
  15. {% block layout_head_meta_tags_schema_webpage %}
  16. {{ parent() }}
  17. {% if activeRoute == 'sas.frontend.blog.detail' %}
  18.     <script type="application/ld+json">
  19.         {
  20.             "@context": "https://schema.org",
  21.             "@type": "BlogPosting",
  22.             "headline": "{{ entry.translated.title }}",
  23.             "datePublished": "{{ entry.publishedAt|date('Y-m-d\\TH:i:sP') }}",
  24.             "dateModified": "{{ (entry.updatedAt ?? entry.createdAt)|date('Y-m-d\\TH:i:sP') }}",
  25.             "author": [
  26.                 {
  27.                     "@type": "Organization",
  28.                     "name": "{{ basicConfig.shopName }}",
  29.                     "url": "{{ app.request.uri }}"
  30.                 }
  31.             ],
  32.             {% if entry.media.thumbnails.elements|length %}
  33.             "image":[
  34.                     {% for item in entry.media.thumbnails.elements %}
  35.                         "{{ item.url }}" {{ loop.last ? '' : ',' }}
  36.                     {% endfor %}],
  37.             {% endif %}
  38.             "publisher": [{
  39.                 "name": "{{ basicConfig.shopName }}",
  40.                 "url": "{{ app.request.uri }}"
  41.             }]
  42.         }
  43.     </script>
  44. {% endif %}
  45. {% endblock %}