How do you hide blank metafield when empty - Creative Theme

Topic summary

A user is trying to hide a Product Story block in the Creative Theme when the product story image metafield is empty. Currently, the block displays a default Shopify placeholder image instead of hiding completely.

Current Issue:

  • User found similar solutions in other threads but cannot apply them to the Creative Theme
  • The relevant code exists only in a JSON file, not in a Liquid file as other solutions reference
  • Unable to directly edit the JSON file to implement conditional logic

Suggested Solution:
Another user recommends adding conditional Liquid code where the story block renders:

{% if product.metafields.custom.award_badge.value != blank %}
  [story block content here]
{% endif %}

Remaining Question:
The original poster is unclear about where to place this code, asking whether it should go in a Liquid file (which they cannot locate) or in the “section-liquid.liquid” file. The discussion remains open with the implementation location unresolved.

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

I’ve read the various other threads ( https://community.shopify.com/topic/1627579 ) on this same topic, but unable to get it to work on my Creative Theme, and I’m not sure if I’m misreading something or if my theme files are different.

I see a json file with the code but I am unable to find any liguid file that the various threads on this topic seem to be referring too.

I would like to hide the entire Product Story block when the product story image is not entered. It currently appears showing the default shopify place holder image when an image has not be selected. Below is the code from the json which looks similar to the code provided in the previously mentioned thread, but the json file doesn’t allow me to enter it.

As reference, I don’t want this place holder thumbnail (or bottom divider line for that matter) to appear when content hasn’t been added:

Thanks in advance.

“b3b04161-7baf-4edb-9b7d-020c67932289”: {
“type”: “profile”,
“settings”: {
“title”: “{{ product.metafields.custom.award_badge_title.value }}”,
“style”: “h3”,
“text”: “

{{ product.metafields.custom.award_badge_description | metafield_tag }}</p>”,
“divider”: false,
“image_toggle”: true,
“image”: “{{ product.metafields.custom.award_badge.value }}”,
“image_ratio”: “circle”,
“image_fit”: true,
“layout_desktop”: “desk-col-2”,
“layout_mobile”: “mob-col-2”,
“link_title”: “”,
“link”: “{{ product.metafields.custom.award_badge_link.value }}”,
“link_style”: “body”
}
},
“eb49ef92-1d1e-44fd-b080-b45004748108”: {
“type”: “spacer”,
“settings”: {
“top”: “none”,
“bottom”: “none”,
“border”: true
}
},

Hello @rynobot
you can add below code where your story block renders on liquid section

{% if product.metafields.custom.award_badge.value != blank %}

story block content goes here
{% endif %}

To clarify, do you mean in a liquid file? If so, I am unable to locate a liquid file that contains the relevant code. The only place I can find it is in a json file.

Unless this is suppose to be somehow added to the “section-liquid.liquid” file which appears like this:

{{ section.settings.custom_liquid }}

{% schema %}
{
“name”: “Custom Liquid”,
“tag”: “section”,
“class”: “js-section__liquid”,
“settings”: [
{
“type”: “liquid”,
“id”: “custom_liquid”,
“label”: “Custom Liquid”
}
],
“presets”: [
{
“name”: “Custom Liquid”
}
]
}
{% endschema %}

Thanks.