custom/static-plugins/NdTheme/src/Resources/views/storefront/element/cms-element-faq.html.twig line 1

Open in your IDE?
  1. {% block element_faq %}
  2.     {% set firstItem = element.config.groups.value[0].name %}
  3.     {% set groups = element.config.groups.value %}
  4.     <section class="nd-cms-el-faq faq lg:theme-grid boxed-layout my-4">
  5.         <div class="flex w-full flex-col overflow-hidden lg:flex-row lg:grid-gap-11 lg:col-span-10 lg:col-start-2 xl:col-span-8 xl:col-start-3">
  6.             {% if groups | length > 1 %}
  7.                 {% block element_faq_ul_style %}
  8.                     <ul class="faq-select nav nav-tabs ml-10 flex md:flex-col flex-nowrap grid-gap-4 overflow-x-scroll flex-shrink-0 lg:w-[300px] md:mr-10 lg:mr-0 lg:block lg:overflow-visible">
  9.                         {% for group in groups %}
  10.                             {% set name = 'FAQ_' ~ loop.index %}
  11.                             <li class="custom-select-ul-child flex items-center grid-gap-4 text-base leading-8 text-black first:pl-8 last:pr-8 md:first:pl-0 md:last:pr-0">
  12.                                 <a class="tab-trigger border-b border-transparent whitespace-nowrap text-base py-2 text-black font-bold w-full flex grid-gap-4 justify-between items-center lg:whitespace-normal {% if loop.first %}active{% endif %}"
  13.                                    href="#{{ name }}_tab"
  14.                                    id="{{ name }}-tab"
  15.                                    data-toggle="tab"
  16.                                    role="tab"
  17.                                    aria-control="{{ name }}_tab"
  18.                                    aria-selected="true">
  19.                                     {{ group.name }}
  20.                                 </a>
  21.                                 {% if not loop.last %}
  22.                                     <span class="seperator md:hidden">&bull;</span>
  23.                                 {% endif %}
  24.                             </li>
  25.                         {% endfor %}
  26.                     </ul>
  27.                 {% endblock %}
  28.             {% endif %}
  29.             {% block element_faq_margin_top %}
  30.             <div class="faq-container tab-content mt-5 w-full sm:inline-block lg:mt-0 {% if groups | length > 1 %}xl:col-span-9{% else %}xl:col-span-6 xl:col-start-4{% endif %}">
  31.                 {% endblock %}
  32.                 {% for group in groups %}
  33.                     {% set name = 'FAQ_' ~ loop.index %}
  34.                     <div class="faq-subject-container tab-pane fade {% if loop.first %}active show{% endif %} grid grid-gap-y-4"
  35.                          id="{{ name }}_tab"
  36.                          role="tabpanel"
  37.                          aria-labelledby="{{ name }}-tab">
  38.                         {% for key, qa in group.qa %}
  39.                             {% if qa.answer and qa.question %}
  40.                                 {% block  element_faq_style %}
  41.                                     <div class=" border-b border-grey-400 py-2 mb-10 mx-10 lg:mx-0"
  42.                                          x-data="{ id: {{ key }}, get expanded() { return this.active === this.id }, set expanded(value) { this.active = value ? this.id : null } }">
  43.                                         <div class="faq-question question-btn text-base font-bold text-black cursor-pointer leading-8 w-full flex"
  44.                                              x-on:click="expanded = !expanded"
  45.                                              :aria-expanded="expanded">
  46.                                         <span x-show="!expanded"
  47.                                               aria-hidden="true"
  48.                                               class="block w-6 h-6">+</span>
  49.                                             <span x-show="expanded"
  50.                                                   aria-hidden="true"
  51.                                                   class="block w-6 h-6">-</span>
  52.                                             {{ qa.question }}
  53.                                         </div>
  54.                                         <div class="faq-answer wysiwyg"
  55.                                              x-show="expanded" x-collapse.duration.500ms>
  56.                                             <div class="pt-3">
  57.                                                 {{ qa.answer|raw }}
  58.                                             </div>
  59.                                         </div>
  60.                                     </div>
  61.                                 {% endblock %}
  62.                             {% endif %}
  63.                         {% endfor %}
  64.                     </div>
  65.                 {% endfor %}
  66.             </div>
  67.         </div>
  68.     </section>
  69. {% endblock %}