How do I fix my metafield IF statement issue in Shopify?

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. It shows the image but as soon as I put in the IF statement it doesn’t work.

I have tried the “value” field of the metafield but that still doesn’t work.

Here is what the end result should be with photos of the metafields in the shopify Admin.


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

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

        	
       		
        {% endif %}
      
      

      

      

Hi @Sm3agal ,

Your if/else function is incorrect, please change:

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

Hope it is clear to you.

If my answer can help you solve your issue, please mark it as a solution. Thank you and good luck.

Good day LitCommerce

I only saw now that my if statement had a misspelling. I feel like such an idiot now. Thank you for your assistance.