Shopify themes, liquid, logos, and UX
I am trying to set the last accordion (see the image) open by default, tried copying the open by default setting and html from the tabs section into the accordion liquid but still couldnt seem to set it open by default. Anyone know how to do this? Would appreciate it a lot!
Hi @Issyeissue, Can you please share your store URL?
Hi @Issyeissue, Thanks for the URL. I checked and found that to open the last accordion you need to make some changes to the accordion file.
First, you need to open the theme code editor and find the accordion file in Sections. Once you find the file find the "details" tag in your file.
Set the attribute aria-expanded='true' and add the attribute open when forloop index is last. Replace the below code in your file.
<details class="accordion group " is="accordion-disclosure" aria-expanded="{% if forloop.last %}true{% else %}false{% endif %}" {% if forloop.last %} open {% endif %} >
Now it looks like this
Can you share the code you have made changes so I can check what's the issue.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024