Why isn't my metafield if statement showing only models with building instructions?

Good day guys

I have a metafield that displays building instructions for models except we haven’t loaded all the building instructions as of yet so we only want the ones to show that has a value in the metafield.

Below is my coding but for some reason it doesn’t work. I am still a junior dev when it comes to development and css coding.


		{% if product.metafields.myfields.building_manual_image != blank %}
         	

**Click on the below image to download the building instructions**

        	
       		
        {% endif %}
      
      

      

      

Try using value for metafield definitions( mfdefs)

{{ product.metafields.my_fields.building_manual.value }}

It’s a poorly documented critical part of using the new metafield definitions and is a constant source of friction with liquids poor error messaging.

And for clarity keep in mind the data put on 1 products own metafield definition in it’s admin IS NOT shared with other products, so be sure the data actually exists as part of troubleshooting metafield definitions.

Hi Paul

I have tried to put “value” afterwards except it still doesn’t work.

Do you perhaps need the whole template file?

Double check for typos’ i.e. manaul instead of manual in the admin settings.

Do you have this issue with other mfdefs?

What is the output source?

What happens if you put it through a | json filter

Reduced test case - Have you tested the relevant code in isolation to rule out silent errors in others parts of the code?

Review the docs for something we’re missing

https://shopify.dev/apps/metafields

https://shopify.dev/api/liquid/objects/metafield

Good day Paul

I checked for Typos. It is as soon as I put that IF statement in that it gives that problem.

It outputs a text field and then an image below it with a URL attached to the image which is a PDF file for download.

Below is screenshots of the metafields in admin and then the output it gives.