How To Create FAQs Page for Shopify Theme Dawn | Creating Accordions in Shopify Theme Development Post author:Ramzan Post published:October 6, 2021 Post category:Shopify Post comments:0 Comments 1. Create template page.faq.json { "sections": { "main": { "type": "main-page-faq" } }, "order": ["main"] } 2. Create section main-page-faq.liquid <link rel="stylesheet" href="{{ 'section-main-page.css' | asset_url }}" media="print" onload="this.media='all'"> <link rel="stylesheet" href="{{ 'component-rte.css' | asset_url }}" media="print" onload="this.media='all'"> <link rel="stylesheet" href="{{ 'faq-style.css' | asset_url }}" media="print" onload="this.media='all'"> <noscript>{{ 'section-main-page.css' | asset_url | stylesheet_tag }}</noscript> <noscript>{{ 'component-rte.css' | asset_url | stylesheet_tag }}</noscript> <div class="page-width page-width--narrow"> <h1 class="main-page-title page-title h0"> {{ page.title | escape }} </h1> <div class="rte"> {{ page.content }} </div> <div class="faq-container"> <div class="tabs"> {% for block in section.blocks %} {% assign item = block.settings %} <div class="tab"> <input type="checkbox" id="faq_checkbox_{{ forloop.index }}" class="faq-checkbox"> <label for="faq_checkbox_{{ forloop.index }}" class="tab-label button button--primary">{{ item.question }}</label> <div class="tab-content">{{ item.answer }}</div> </div> {% endfor %} </div> </div> </div> {% schema %} { "name": "FAQ Page", "tag": "section", "class": "spaced-section", "blocks": [ { "name": "FAQ Item", "type": "faq", "settings": [ { "type": "text", "id": "question", "label": "Question", "default": "Do you have a question?" }, { "type": "richtext", "id": "answer", "label": "Answer", "default": "<p>I have an answer</p>" } ] } ] } {% endschema %} 3. Create faq-style.css in Assets folder .faq-checkbox { position: absolute; opacity: 0; z-index: -1; } .tabs { border-radius: 10px; overflow: hidden; } .tab { width: 100%; color: white; overflow: hidden; } .tab-label { width: 100%; display: flex; justify-content: space-between; padding: 1em; font-weight: bold; color: white; } .tab-label:after { content: "+"; width: 1em; height: 1em; text-align: center; transition: all 0.5s; } .tab-content { max-height: 0; padding: 0 1em; background-color: white; transition: all 0.5s; color: black; } .tab-content p { margin: 0; } .faq-checkbox:checked + .tab-label:after { content: "-"; } .faq-checkbox:checked ~ .tab-content { max-height: 100vh; padding: 1em; } Hire Me Try Shopify free for 14 days Start free trial Tags: accordions, answer, dawn, faq, question, shopify Please Share This Share this content Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Read more articles Previous PostHow To Create Color Swatches for Product Variants in Shopify (Dawn Theme) Next PostHow To Create Sales Popup Notifications of Products in Shopify (Without Shopify Apps) You Might Also Like Dawn Theme – How To Remove Logo Only From Homepage? March 10, 2022 Animated Typing Effect Shopify Section | Without App | Stylish Text Animation | [100% Conversion] July 13, 2023 How to Add Featured Product Slider In Shopify Store August 24, 2023 Leave a Reply Cancel replyCommentEnter your name or username to comment Enter your email address to comment Enter your website URL (optional) Save my name, email, and website in this browser for the next time I comment. Δ
Animated Typing Effect Shopify Section | Without App | Stylish Text Animation | [100% Conversion] July 13, 2023