Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Preventing dynamic source from showing

Preventing dynamic source from showing

sm03
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)