{% sw_extends '@Storefront/storefront/component/feature.html.twig' %}
{% block component_head_feature %}
{{ parent() }}
{% block huebseo_faq_json %}
{% set faqElements = [] %}
{% for defaultEntity in page.cmsPage.sections.elements %}{% if defaultEntity.type == "default"%}
{% for blockElement in defaultEntity.blocks.elements %}
{% for slotElement in blockElement.slots.elements %}{% if slotElement.type == "hueb-faq-element" and slotElement.config.question.value %}
{% set faqElements = faqElements|merge(slotElement.config.question.value) %}
{% endif %}{% endfor %}
{% endfor %}
{% endif %}{% endfor %}
{% if faqElements %}
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "FAQPage",
"mainEntity": [
{% for question in faqElements %}
{
"@type": "Question",
"name": "{{ question.question }}",
"acceptedAnswer": {
"@type": "Answer",
"text": "{{ question.answer }}"
}
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}
</script>
{% endif %}
{% endblock %}
{% endblock %}