A space to discuss online store customization, theme development, and Liquid templating.
Hello! So the thing is I like a lot the new Dawn theme, but I wonder how can I play with the metadata fields so I can only show the fields that contain information. So for example in some of my products I have a retractable tab with "Features", "Materials" and "Size", but in other product I might have info in "How to use it" for example. I just want the product to show this retractable tabs when they contain information in the product. I don't want for example to click on "Size" and nothing shows up.
Is it posible to do this?
Solved! Go to the solution
This is an accepted solution.
I solved an issue just like this by adding an if statement in my template code.
{% when 'block' %} // eg. "Materials"
// ...original code for the accordion
{% when 'block' %}
{% if metafield.product.namespace.key %}
// ...original code for the accordion
{% endif %}
This is an accepted solution.
I solved an issue just like this by adding an if statement in my template code.
{% when 'block' %} // eg. "Materials"
// ...original code for the accordion
{% when 'block' %}
{% if metafield.product.namespace.key %}
// ...original code for the accordion
{% endif %}