Looking to hide Meta Fields that contain no data in Empire theme

Looking to hide Meta Fields that contain no data in Empire theme

TileTools-1
Visitor
3 0 0

I am adding custom Metafields to my site and not all products are applicable - I am using the Empire theme  any help would be appreciated
https://tiletools.com/products/gundlach-red-urethane-grout-float

Reply 1 (1)

Guleria
Shopify Partner
3401 679 963

Hello @TileTools-1 ,

 

With liquid you can make the metafields conditional 

e.g.

{% if product.metafields.namespace.key != blank %} 
  {{ product.metafields.namespace.key }} 
{% endif %}

 

Or you can write a script which will check if there is content available for the tab or not.
If not then use hide the parent element.

 

Hope it will give you an idea to write code a/to your needs.

 

Thanks

- If helpful then please Like and Accept Solution.
- Drop an email   if you are looking for quick fix or any customization
- Email: [email protected]
- Try GEMPAGES a great page builder