All things Shopify and commerce
Hello,
I want to display add faq section on each collection page where admin can add faq's dynamically.
so i have added below code. now code is working correctly i am able to add faq from backend on collection page, but same faqs data display on all collection pages. every collection page has a diffrent faq data . eg veliche page valiche faq, sparta page sparta faq.
<section class="sf__pages-other" data-section-id="{{ section.id }}" data-section-type="page-faqs">
<div class="container">
<div class="flex flex-col-reverse lg:flex-row">
{% if section.settings.menu != blank %}
<div class="lg:w-3/12 lg:pr-24 mt-6 lg:mt-0">
<ul class="sf__list-row sf__list-row-border">
{%- for link in linklists[section.settings.menu].links -%}
<li{% if link.active %} class="active"{% endif %}><a href="{{ link.url }}"><span>{{ link.title }}</span></a></li>
{%- endfor -%}
</ul>
</div>
{% endif %}
<div class="{% if section.settings.menu != blank %}lg:w-9/12{% else %}w-full{% endif %}">
{% for block in section.blocks %}
{% case block.type %}
{% when 'content' %}
{% if block.settings.content != blank %}
<div class="{% if forloop.index == 1 %}mb-10{% else %}my-10{% endif %}">
{{ block.settings.content }}
</div>
{% endif %}
{% else %}
{% if block.settings.title != blank and block.settings.content != blank and collection.all_vendors %}
<div class="sf__accordio-blocks sf__custom-accordion">
<div class="sf__accordion-item{% if block.settings.open %} open{% endif %}">
<h3 class="sf__accordion-button text-lg">{{ block.settings.title }}</h3>
<div class="sf__accordion-content text-base text-color-subtext">{{ block.settings.content }}</div>
</div>
</div>
{% endif %}
{% endcase %}
{% endfor %}
</div>
</div>
</div>
</section>
{% schema %}
{
"name": "FAQ",
"settings": [],
"blocks": [
{
"type": "content",
"name": "Custom content",
"settings": [
{
"type": "html",
"id": "content",
"label": "Content",
"info": "Allow html code"
}
]
},
{
"type": "accordion",
"name": "Accordion item",
"settings": [
{
"type": "textarea",
"id": "title",
"label": "Heading",
"default": "Question Name"
},
{
"type": "richtext",
"id": "content",
"label": "Content",
"default": "<p>Answer Content</p>"
},
{
"type": "checkbox",
"id": "open",
"label": "Open Tab By Default",
"default": false
}
]
}
],
"presets": [
{
"name": "FAQs",
"blocks": [
{
"type": "accordion"
},
{
"type": "accordion"
},
{
"type": "accordion"
},
{
"type": "accordion"
}
]
}
]
}
{% endschema %}
{% stylesheet %}
{% endstylesheet %}
{% javascript %}
{% endjavascript %}
Hi @innois
I guess you need to create template for each collection to have different FAQ section. You can check this to learn how to create a new template
- Helpful? Like and Accept solution! Or Support me: Buy Coffees
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Hi @innois ,
This is David at SalesHunterThemes.
So that every collection page has a different faq data you can create a template collections:
If I managed to help you then, don’t forget to Like it and Mark it as Solution!
David | SalesHunterThemes team
We create fast Shopify themes, focusing on exceptional performance and seamless experience across all devices.
Try our Electro theme Free! (Now at Black Friday price)
Hi @innois , kindly check out the below video:
If my reply is helpful, kindly click like and mark it as an accepted solution.
Thanks!
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024