Hide metafields when blank through description

Hi guys, i tried following the previous question here:https://community.shopify.com/c/technical-q-a/hide-metafields-when-they-are-blank/m-p/1721222#M101918

But it doesn’t seem to work.

I’ve added the code, but did i do something wrong? It’s just showing the entire code instead:

I’ve added the liquid code to multicolumn as instructed:

Tupperton_1-1662370759825.png

Can you help me? @LitExtension

Hi @Tupperton ,

Did you change the type to liquid?

Hi Lit,

Thank you for your reply, I did change the code to liquid as mentioned above.

Site is: https://housedoctor-shop.myshopify.com/

Pass: soltest

Hi, @Tupperton Hope you are doing Well. Can you please share the product.json file with the product meta fields screenshot?

1 Like

Here you go:

{
“sections”: {
“166184649094879044”: {
“type”: “custom-liquid”,
“settings”: {
“custom_liquid”: “GO BACK”,
“full_width”: false,
“show_divider”: false,
“padding_top”: 40,
“padding_bottom”: 0
}
},
“main”: {
“type”: “main-product”,
“blocks”: {
“breadcrumb”: {
“type”: “breadcrumb”,
“settings”: {
“text_style”: “uppercase”,
“show_divider”: true
}
},
“title”: {
“type”: “title”,
“settings”: {
“title_size”: “h2”
}
},
“price”: {
“type”: “price”,
“settings”: {
}
},
“description”: {
“type”: “description”,
“settings”: {
}
},
“68420751-ad84-4a17-b08f-4c436840dbf8”: {
“type”: “collapsible_tab”,
“settings”: {
“icon”: “none”,
“heading”: “Product details”,
“content”: “

Size: {{ product.metafields.custom.size | metafield_tag }} {{ product.metafields.custom.bynord | metafield_tag }}</p>

Material: {{ product.metafields.custom.material | metafield_tag }}</p>

Color: {{ product.metafields.custom.color | metafield_tag }}</p>

Recommended retail price: {{ product.metafields.custom.recommended_retail_price | metafield_tag }} EUR</p>

Care instructions: {{ product.metafields.custom.care_instructions | metafield_tag }}<br/>EAN: {{ product.metafields.custom.ean | metafield_tag }}<br/></p>”,
“page”: “”
}
},
“buy_buttons”: {
“type”: “buy_buttons”,
“settings”: {
“show_quantity_selector”: false,
“show_dynamic_checkout”: false
}
},
“sticky_cart”: {
“type”: “sticky_cart”,
“settings”: {
“show_quantity_selector”: false
}
},
“b4076989-b59e-454d-8219-11344ebeee09”: {
“type”: “share”,
“settings”: {
}
}
},
“block_order”: [
“breadcrumb”,
“title”,
“price”,
“description”,
“68420751-ad84-4a17-b08f-4c436840dbf8”,
“buy_buttons”,
“sticky_cart”,
“b4076989-b59e-454d-8219-11344ebeee09”
],
“settings”: {
“enable_sticky_info”: true,
“media_size”: “large”,
“gallery_layout”: “stacked”,
“image_ratio”: “adapt”,
“show_thumbnails”: false,
“hide_variants”: false,
“enable_image_zoom”: true,
“enable_video_looping”: false,
“mobile_image_ratio”: “adapt_first”,
“show_mobile_thumbnails”: true,
“padding_top”: 0,
“padding_bottom”: 40
}
},
“product-details”: {
“type”: “product-details”,
“disabled”: true,
“settings”: {
“heading”: “Product info”,
“heading_size”: “h2”,
“padding_top”: 40,
“padding_bottom”: 40
}
},
“product-recommendations”: {
“type”: “product-recommendations”,
“settings”: {
“heading”: “You May Also Like”,
“heading_size”: “h2”,
“show_divider”: false,
“columns_mobile”: “2”,
“swipe_on_mobile”: true,
“image_ratio”: “portrait”,
“image_position”: “center center”,
“enable_image_fill”: true,
“show_secondary_image”: true,
“show_vendor”: false,
“show_rating”: false,
“show_quick_buy”: false,
“enable_quick_view”: false,
“enable_color_swatches”: false,
“enable_countdown”: false,
“padding_top”: 40,
“padding_bottom”: 80
}
},
“recently-viewed-products”: {
“type”: “recently-viewed-products”,
“settings”: {
“heading”: “Recently Viewed”,
“heading_size”: “h2”,
“show_divider”: false,
“columns_mobile”: “2”,
“swipe_on_mobile”: true,
“image_ratio”: “portrait”,
“image_position”: “center center”,
“enable_image_fill”: true,
“show_secondary_image”: true,
“show_vendor”: false,
“show_rating”: false,
“show_quick_buy”: false,
“enable_quick_view”: false,
“enable_color_swatches”: false,
“enable_countdown”: false,
“padding_top”: 40,
“padding_bottom”: 80
}
}
},
“order”: [
“166184649094879044”,
“main”,
“product-details”,
“product-recommendations”,
“recently-viewed-products”
]
}

@Tupperton Can you please share main-product.liquid code as well

Hi @Tupperton ,

I checked and your content tab is still not changed, can you send me the code of main-product.liquid file, I will check it for you.

Attached :slightly_smiling_face:

@Tupperton please change the type to liquid instead of richtext

Hi @Tupperton ,

Please change code here:

Hope it helps!

1 Like

Thank you!

That’s what was missing. I added the code to metafields, not main-product.

Works perfectly now.

1 Like

What file is that? I am using symmetry theme btw.

Hi @Vicki_Reale ,

You can create a question on the community and send me the link. I will check it.
Because this will help build a better community.
Thank you.

I followed this video guide and found the step by step way to hide the metafileds from my product page which were blank:

Video: https://youtu.be/_9rtNdM6n1A