{% block acris_faq_wrapper %}
{% set cover = faqs.media %}
{% set imagePosition = faqs.imagePosition %}
{% if imagePosition == '' %}{% set imagePosition = 'right' %}{% endif %}
{% set videoPosition = faqs.videoPosition %}
{% if videoPosition == '' %}{% set videoPosition = 'right' %}{% endif %}
{% set imageUrlType = faqs.imageUrlType %}
{% set imageUrlEntity = faqs.imageUrlEntity %}
{% set imageUrl = null %}
{% if imageUrlType is same as 'internal' and imageUrlEntity is same as 'product' %}
{% set imageUrl = seoUrl('frontend.detail.page', {'productId': faqs.imageInternalLink}) %}
{% elseif imageUrlType is same as 'internal' and imageUrlEntity is same as 'category' %}
{% set imageUrl = seoUrl('frontend.navigation.page', { navigationId: faqs.imageInternalLink }) %}
{% elseif imageUrlType is same as 'internal' and imageUrlEntity is same as 'landing_page' %}
{% set imageUrl = path('frontend.cms.page', { id: faqs.imageInternalLink }) %}
{% elseif imageUrlType is same as 'external' %}
{% if faqs.translated.imageUrl %}
{% set imageUrl = faqs.translated.imageUrl %}
{% endif %}
{% endif %}
{% set imageUrlTarget = faqs.imageUrlTarget %}
{% set videoUrl = faqs.translated.embedCode %}
{% if faqSingle %}{% set id = (faqs.id ~ '-single') %}{% else %}{% set id = faqs.id %}{% endif %}
{% set faqDocument = faqs.acrisFaqDocuments.elements %}
{% set imageSizes = {} %}
{% if faqs.imageSize == 'small' %}
{% set imageSizes = {
'default': '120px'
} %}
{% elseif faqs.imageSize == 'medium' %}
{% set imageSizes = {
'default': '280px'
} %}
{% elseif faqs.imageSize == 'large' %}
{% set imageSizes = {
'default': '400px'
} %}
{% else %}
{% set imageSizes = {
'default': '95px'
} %}
{% endif %}
{% set iconStyle = config('AcrisFaqCS.config.iconType') == null ? 'plus' : config('AcrisFaqCS.config.iconType') %}
{% set iconPosition = config('AcrisFaqCS.config.iconPosition') == null ? 'right' : config('AcrisFaqCS.config.iconPosition') %}
{% set questionBgColor = config('AcrisFaqCS.config.questionBgColor') == null ? 'primary' : config('AcrisFaqCS.config.questionBgColor') %}
{% set customTitleBgColor = config('AcrisFaqCS.config.customTitleBgColor') == null ? null : config('AcrisFaqCS.config.customTitleBgColor') %}
{% set customTitleColor = config('AcrisFaqCS.config.customTitleColor') == null ? null : config('AcrisFaqCS.config.customTitleColor') %}
{% set answerBgColor = config('AcrisFaqCS.config.answerBgColor') == null ? null : config('AcrisFaqCS.config.answerBgColor') %}
{% set titleBorderColor = config('AcrisFaqCS.config.titleBorderColor') == null ? null : config('AcrisFaqCS.config.titleBorderColor') %}
{% if customTitleBgColor is empty %}
{% set questionBgColor = 'primary' %}
{% endif %}
{% set htmlHeadlineTag = 'div' %}
{% if detailPage %}
{% set htmlHeadlineTag = 'h1' %}
{% endif %}
<style>
{% if questionBgColor is same as 'custom' %}
.acris-faq-accordion-wrapper#faq_group_{{ id }} .acris-faq-accordion-header {
background-color: {{ customTitleBgColor }};
}
{% endif %}
{% if customTitleColor != '' and customTitleColor is not null %}
.acris-faq-accordion-wrapper#faq_group_{{ id }} .acris-faq-accordion-header {
color: {{ customTitleColor }};
}
.acris-faq-accordion-wrapper#faq_group_{{ id }} .acris-faq-accordion-header span {
color: {{ customTitleColor }};
}
{% endif %}
{% if answerBgColor != '' and answerBgColor is not null %}
.acris-faq-accordion-wrapper#faq_group_{{ id }} .acris-faq-accordion-content .card {
background-color: {{ answerBgColor }};
}
{% endif %}
.title-font-color{
color: {{ customTitleColor }} !important;
}
{% if titleBorderColor %}
.acris-faq-accordion-wrapper#faq_group_{{ id }} .acris-faq-accordion-content.show-border {
border-color: {{ titleBorderColor }};
}
{% endif %}
</style>
{% block acris_faq_container %}
<div class="acris-faq-accordion-wrapper" data-acris-faq="true" id="faq_group_{{ id }}" itemscope
itemprop="mainEntity" itemtype="https://schema.org/Question">
{% block acris_faq_content_question %}
<a class="acris-faq-accordion-header{% if detailPage != true or not faqs.collapsed == 'notCollapsed' %} collapsed{% endif %} btn{% if questionBgColor is not same as 'custom' %} btn-{{ questionBgColor }}{% endif %}{% if iconPosition is same as 'left' %} question-right{% endif %} icon-style-{{ iconStyle|lower }}{% if config('AcrisFaqCS.config.titlePadding') == "noPadding" %} p-0{% endif %}"
href="{{ path('frontend.faq.detail', {'faqId': id}) }}"
role="button"
target="_blank"
rel="noopener"
data-toggle="collapse" data-target="#faq-{{ id }}"
{% if faqs.collapsed == 'notCollapsed' %} aria-expanded="true" {% else %} aria-expanded="false" {% endif %}
aria-controls="faq-{{ id }}">
{% if iconPosition is same as 'left' %}
{% if iconStyle is same as 'plus' %}{% sw_icon 'plus' %}{% elseif iconStyle is same as 'arrow' %}{% sw_icon 'arrow-head-down' %}{% else %}<span class="icon-plus-minus"></span>{% endif %}
{% endif %}
<{{ htmlHeadlineTag }} class="acris-faq-text text-left{% if detailPage %} title-font-color{% endif %}" itemprop="name">{{ faqs.translated.name }}</{{ htmlHeadlineTag }}>
{% if iconPosition is same as 'right' %}
{% if iconStyle is same as 'plus' %}{% sw_icon 'plus' %}{% elseif iconStyle is same as 'arrow' %}{% sw_icon 'arrow-head-down' %}{% else %}<span class="icon-plus-minus"></span>{% endif %}
{% endif %}
</a>
{% endblock %}
{% block acris_faq_content_answer %}
<div class="acris-faq-accordion-content{% if config('AcrisFaqCS.config.titleBorder') == "showBorder" %} show-border{% endif %}">
<div class="row">
<div class="col-12">
<div
class="collapse{% if detailPage == true or faqs.collapsed == 'notCollapsed' %} show{% endif %}"
id="faq-{{ id }}">
<div
class="card card-body faq-wrapper-answer{% if answerBgColor is empty %} faq-wrapper-answer-background{% endif %}{% if not faqs.translated.description %} no-text {% endif %}{% if videoUrl == null %} no-video {% elseif not faqs.translated.description %} faq-video {% else %} video-position-{{ videoPosition }}{% endif %} video-wrapper {% if faqs.mediaId == null %} no-image{% else %} image-position-{{ imagePosition }}{% endif %}{% if config('AcrisFaqCS.config.contentPadding') == "noPadding" %} p-0{% endif %}"
itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer">
{% if faqs.layout == 'cms' and faqs.cmsPageId != null %}
<div itemprop="text" hidden>
<p>{{ faqs.translated.description|raw }}</p>
</div>
{% sw_include '@Storefront/storefront/page/content/detail.html.twig' with { cmsPage: faqs.cmsPage } %}
{% else %}
{% if videoUrl %}
{% sw_include '@Storefront/storefront/component/faq/video/acris-faq-video.html.twig' %}
{% endif %}
{% if faqs.translated.description %}
{% block acris_faq_content_answer_description %}
<div class="faq-text" itemprop="text">
<p>{{ faqs.translated.description|raw }}</p>
</div>
{% endblock %}
{% endif %}
{% if cover.url %}
{% block acris_faq_content_answer_image %}
{% if cover.thumbnails.elements|length > 0 %}
{% set image = cover.thumbnails|sort|first().url %}
{% else %}
{% set image = cover.url %}
{% endif %}
{% if imagePosition == 'left' or imagePosition == 'right' %}
<div
class="faq-image image-position-{{ imagePosition }}">
<a {% if imageUrl %}href="{{ imageUrl }}" {% endif %}
rel="noopener"
target="{{ imageUrlTarget }}">
{% sw_thumbnails 'cart-item-img-thumbnails' with {
media: cover,
sizes: imageSizes,
attributes: {
'class': 'img-fluid',
'alt': (faqs.translated.internalName ?: ''),
'title': (entity.media.translated.title ?: '')
}
} %}
</a>
</div>
{% else %}
<div class="faq-image-{{ imagePosition }}">
<a href="{{ imageUrl }}"
rel="noopener"
target="{{ imageUrlTarget }}">
{% sw_thumbnails 'cart-item-img-thumbnails' with {
media: cover,
sizes: imageSizes,
attributes: {
'class': 'img-fluid',
'alt': (faqs.translated.internalName ?: ''),
'title': (entity.media.translated.title ?: '')
}
} %}
</a>
</div>
{% endif %}
{% endblock %}
{% endif %}
{% if faqDocument|length > 0 %}
{% block acris_faq_content_answer_document %}
<div class="faq-document">
<div class="h5">{{ 'acris-faq.detail.documentTitle'|trans }}</div>
<ul>
{% for item in faqDocument %}
<li><a download
target="_blank"
rel="noopener"
href="{{ item.media.url }}"
>{% if item.translated.title %}{{ item.translated.title }}{% else %}{{ item.media.fileName }}.{{ item.media.fileExtension }}{% endif %}</a>
{% if item.translated.description %} - {{ item.translated.description }}{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endblock %}
{% endif %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endblock %}
</div>
{% endblock %}
{% endblock %}