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.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

How do I reference metafields of a nested metaobject?

How do I reference metafields of a nested metaobject?

h4h90
Visitor
3 0 1

Hi. I have a metaobject which provides five file inputs (Images). This metaobject is a metafield of a product. Overview:

 

Product

Product Metafield

Metaobject

Metafield 1: Image

Metafield 2: Image

Metafield 3: Image

Metafield 4: Image

Metafield 5: Image

 

Names

Product Metafield (that hosts the metaobject) product.metafields.custom.old_images

Metaobject: old_images_linking

Image 1 - 5 metafields within metaobject: image_1, image_2 aso.

 

I want to write a custom liquid code on the product default template in the shopify theme editor. Within this custom css I want to have an if function, that hides #shopify-element-xxx if the metafield image_1 of the metaobject that this product is connected to is empty. 

 

I know how to write the code. But I need help understanding how I specifically target this field. 

So far I have tried

 

{% if product.metafields.custom.old_images.old_images_linking.image_1 == blank %} etc...

But this is not working.

 

Anyone help? Thank you !

 

Replies 0 (0)