Hi everyone,
hoping to get some help on my issue.
The shop has some products requiring info and an image. In order to be able to use the file metafield, I changed the collapsible row content from richtext to liquid, which worked fine. But some products don’t need the rows at all and while this https://community.shopify.com/c/technical-q-a/hide-empty-collapsible-tabs-in-dawn-theme/td-p/1534276 hid them before, it still displays them after the switch to liquid. Any help would be appreciated.
The product is https://stoffwearshop.myshopify.com/products/ankomm-cd (pw eaghoh)
and my current collapsible-content.liquid includes this
Thank you!
Hello @kamicreative
We have updated the code for you, Please use this html code and update screenshot code with the following HTML code.
{%- for block in section.blocks -%}
{%- if block.settings.heading != blank or block.settings.row_content != blank or block.settings.page.content != blank -%}
{%- if block.settings.heading != blank and block.settings.row_content != blank -%}
__*If you find our reply helpful, please hit Like and Mark it as a Solution.*__
An award-winning North American [Shopify Development Agency](https://webdesksolution.com/shopify-development/?utm_source=SC&utm_medium=ShopifyC&utm_campaign=Shopify+Community) That Delivers Powerful Results, Innovation, and Secure Digital Transformation.
Thank you for your help! I updated the quote and it told me there was still an open tag, so this is what it looks like now. Unfortunately, it is still displaying the empty rows in the frontend. What did I do wrong? Really appreciate your help!
Hello @kamicreative
Please use the following HTML code.
{%- for block in section.blocks -%}
{%- if block.settings.heading != blank or block.settings.row_content != blank or block.settings.page.content != blank -%}
{%- if block.settings.heading != blank and block.settings.row_content != blank -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
If you find our reply helpful, please hit Like and Mark it as a Solution.
An award-winning North American Shopify Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.
I’m so sorry, but it is still showing the empty collapsible rows (including the no image placeholder), like here: https://stoffwearshop.myshopify.com/products/ankomm-cd
I put the code in the collapsible-content.liquid
I really appreciate your help!
Hello @kamicreative
Once you Log in to the Admin, then process the following steps:
Step 1: Go to Online Store->Theme->Actions->Edit code.
Step 2: Open the file main-product.liquid and replace below code
{% if block.settings.content != blank or block.settings.page.content != blank %}
{{ block.settings.content }}
{{ block.settings.page.content }}
{% endif %}
Step 3: Save
Output:
If you find our reply helpful, please hit Like and Mark it as a Solution.
An award-winning North American Shopify Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.
Thank you. I put the code in, which works, but it still shows me the empty collapsible tabs one the product. I really just want to hide the tabs altogether if they don’t contain any content, but it’s not working unfortunately. What am I doing wrong?