Preventing dynamic source from showing

Shopify Partner
1 0 0

Currently, I can exclude a section from showing using this:

{% if product.metafields.my_fields.icons_1 != blank %}

 However, I am struggling to exclude the second section from showing. For example, some products have 2 sets of icons ad, some have 1 and others have 0. 


With the current code, I can exclude the empty icon section from appearing if the product has either 2 sets of icons or 0. What I am struggling with is preventing the second set of icons from showing if there are only 1 set of icons.


I have provided an example below. Only the top 4 icons have metafield information assigned to them, however the bottom 3 icons still show even though it's blank.

test shopify 2.0.jpg



Hope this all makes sense. Does anyone have any potential solutions?

Replies 0 (0)