vendor/store.shopware.com/huebertseofaq/src/Resources/views/storefront/component/feature.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/feature.html.twig' %}
  2. {% block component_head_feature %}
  3.     {{ parent() }}
  4.     {% block huebseo_faq_json %}
  5.         {% set faqElements = [] %}
  6.         {% for defaultEntity in page.cmsPage.sections.elements %}{% if defaultEntity.type == "default"%}
  7.             {% for blockElement in defaultEntity.blocks.elements %}
  8.                 {% for slotElement in blockElement.slots.elements %}{% if slotElement.type == "hueb-faq-element" and slotElement.config.question.value %}
  9.                     {% set faqElements = faqElements|merge(slotElement.config.question.value) %}
  10.                 {% endif %}{% endfor %}
  11.             {% endfor %}
  12.         {% endif %}{% endfor %}
  13.         {% if faqElements %}
  14.             <script type="application/ld+json">
  15.                 {
  16.                     "@context" : "http://schema.org",
  17.                     "@type" : "FAQPage",
  18.                     "mainEntity": [
  19.                     {% for question in faqElements %}
  20.                     {
  21.                         "@type": "Question",
  22.                         "name": "{{ question.question }}",
  23.                         "acceptedAnswer": {
  24.                             "@type": "Answer",
  25.                             "text": "{{ question.answer }}"
  26.                             }
  27.                     }{% if not loop.last %},{% endif %}
  28.                 {% endfor %}
  29.                     ]
  30.                 }
  31.             </script>
  32.         {% endif %}
  33.     {% endblock %}
  34. {% endblock %}