Dawn 10.0 - hide 'image-with-text' section if metafield is empty (product template)

Topic summary

A user seeks to hide the ‘image-with-text’ section on product pages when product metafields are empty, instead of displaying placeholder images.

Initial Solution:

  • Use conditional Liquid code: {% if product.metafields.custom.inspiration_image != blank %} to check if metafield has content
  • Wrap the section markup with this conditional statement and close with {% endif %}

Implementation:

  • The original poster successfully resolved their issue by wrapping the conditional statement around image-with-text.liquid

Follow-up Issue:
Another user faces a similar problem but with different requirements:

  • Has two Image with Text sections pulling from metaobjects (not direct product metafields)
  • Their attempted code {% if product.metafields.custom.fabric_options != blank %} isn’t working
  • Uncertain whether the code placement is incorrect or if metaobjects require different syntax

The discussion remains open as the second user awaits guidance on the proper conditional code for metaobject-sourced content.

Summarized with AI on November 17. AI used: claude-sonnet-4-5-20250929.

Hello! I’m trying to hide the image-with-text section if the dynamic sourced product metafields are empty rather than seeing the placeholder.

Where and how would I define this? To only display the section if the metafield is not blank?

{% if product.metafields.custom.inspiration_image ! = blank %}

Hello,

To hide the image-with-text section if the dynamic sourced product metafields are empty, you can use conditional rendering in the backend.

{% if product.metafields.custom.inspiration_image != blank %}  
  
 
{% endif %}

Where should this code be placed? image-with-text.liquid or main-product.liquid?

thanks!

I wrapped image-with-text.liquid with the if statement and it worked! thanks

I tried using a similar code, but it’s not working for me. Can you help?

I have two Image with Text sections on my product page, each section is connecting to a dynamic source pulling images and text from a metaobject. When products aren’t using these sections, the metafield is left blank but it’s still showing a place holder image. How can I hide the entire section if the matafield is blank?

I tried the code below in the Image-with-text liquid, but either I’m not putting the code in the proper place, or I need a different code since it’s pulling from a metaobject.

{% if product.metafields.custom.fabric_options != blank %}

{% endif %}