Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi, hoping someone can help me with this. I'm using the Dawn theme on a store I'm building for a client, but having some trouble with collapsible tabs on the product pages.
Each product has a set of FAQs, but they differ in number. I need to be able to add up to 10 collapsible tabs, but some of the products will only have data in, say, three of them. Is it possible to hide the tabs that are empty? They're currently showing as empty lines, like this:
Any advice will be much appreciated!
Solved! Go to the solution
This is an accepted solution.
Hi @Bev_StickMkting,
Please go to sections > collapsible-content.liquid file, find 'section.blocks' and add code here:
Code:
{%- if block.settings.heading != blank or block.settings.row_content != blank or block.settings.page.content != blank -%}
{%- endif -%}
Hope it helps!
Hi @Bev_StickMkting ,
Please share your store URL and if your store is password protected then please provide password too.
So that we can help you.
Thank you.
This is an accepted solution.
Hi @Bev_StickMkting,
Please go to sections > collapsible-content.liquid file, find 'section.blocks' and add code here:
Code:
{%- if block.settings.heading != blank or block.settings.row_content != blank or block.settings.page.content != blank -%}
{%- endif -%}
Hope it helps!
Amazing! Thank you so much, that's worked perfectly 😊
Hi, sorry but on Dawn theme i don't have "sections > collapsible-content.liquid".
how can i do it?
Thanks
MM
Hi @dgallerystore,
You can create a question on the community and send me the link. I will check it.
Because this will help build a better community.
Thank you.
Hi, I tried using this solution, but it didn't work.
Using the Dawn theme and did exactly as written. As you can see below I added the code to the correct places, saved it but nothing is happening. What am I doing wrong?
Thanks in advance!
Works like a charm, thanks!
How do I make it so that the entire section is removed if none of the rows has any content?
Thanks in advance!
All the best,
Jacob
We're using Archtype Streamline theme and the solution for us was a bit different.
We only had to change and to or inside tab.liquid file so that the final thing looks like this:
{%- liquid
assign output_tab = true
if title == blank or content == blank
assign output_tab = false
endif
-%}
This helped me! In my case I had prefilled headings and I wanted to hide blank rows, so I ended up using only the block.settings.row_content one and it's working great. Thank you!
FYI to others - this solution works when you use Collapsible Rows in a different "Collapsible Rows Section." If you're trying to hide rows in the product information section, you should try the other solutions that modify the main-product.liquid section. I started off with one and then ran out of blocks and so have moved to the other. So I'm actually using both solutions and they seem to be working well.
Hi, I'm also having difficulty getting this to work. It seems to work for the collapsible content section but not the collapsible rows within the product information section. Does anyone know how this can be done?
I am also having the same issue
After trying to get this to work for a good 30 minutes I realised the solution wasn’t solving the Collapsible row block on the product page (under the description) but rather the Collapsible content section which is a separate feature. To get this to work for the Collapsible rows you need to edit main-product.liquid and put the condition inside 'collapsible_tab' case like so:
Code for easy copy/paste
{%- if block.settings.content != blank or block.settings.page.content != blank -%}
...
{%- endif -%}
Hope this helps someone 😄
🙏 Thank you for posting your solution, Baldur! This is exactly what I needed. I'm so close to being able to launch my store now that issue has been resolved. 😁
Glad I could help 😊 Good luck 🙌🏻
Hi baldur_Helgason,
Thanks for your help.
Cheers.
Perfect thanks 👏
My guy 😎
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024