I would like to implement a simple Accordion on the Product-Detail-Page. I am using the Dawn-Theme. Does the Dawn Theme have an Accordion out of the Box? If not, how do I start. Are there any good ressources? I do not want to use a Theme App by the way.
For anyone else looking for a solution - I was looking at the dawn demo site and on the product page they already have an accordion. if you inspect the code on the example accordion you will get what you are looking for. All the accordion css is already in the dawn theme under component-accordion.css.
Try below to get started (the built-in one does not have auto close functionality). You will need to also replace the svg tags in below with the liquid code (ex. {% render โicon-closeโ %}).
@King-Kang Same with me. Didnโt look into getting this working either. I only have two accordions on the product page so not a big deal for me.
On another site I run, the below jQuery function is what I used to get you started. If you get it working please post your modified code. You will need to build in the svg arrows (^) & (v) to swap. Below Iโm using the plus (+) & minus (-) signs.
This worked out perfectly for me, but now I have two sets of accordions; the one I created using the above code and the original demo one. How do I remove the demo accordion provided by the template?
@toneee Go to you admin page and in your active theme hit Customize, select Products, select Default Product or the template you use and see if any collapsible blocks are used here.
You could also try to remove the block of code " {%- when โcollapsible_tabโ -%}" in main-product.liquid.
I used the default dawn theme and there were no demo collapsible tabs setup by default so you would have had to setup the meta fields to populate the โdemoโ collapsible tabs.