Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello,
I wonder if anyone can help me resolve the following issue:
I am using the Flex theme by Out of the Sandbox.
I created a custom liquid block to embed an accordion in the Product page template I created. Within the accordion I have links to metafields. The issue is that on the front-end the metafield data is not displayed properly.
Custom liquid code:
<dl class="accordion">
<dt><a href="#" class="active"><small class="right">◄</small>{{product.metafields.custom.tab_1_title }}</a></dt>
<dd class="active">{{product.metafields.custom.tab_1_content}}</dd>
<dt><a href="#" class="active"><small class="right">◄</small>{{product.metafields.custom.tab_2_title}}</a></dt>
<dd class="active">{{product.metafields.custom.tab_2_content}}</dd>
<dt><a href="#" class="active"><small class="right">◄</small>{{product.metafields.custom.tab_3_title}}</a></dt>
<dd class="active">{{product.metafields.custom.tab_3_content}}</dd>
<dt><a href="#" class="active"><small class="right">◄</small>Shipping Information</a></dt>
<dd class="active">Place information on shipping and delivery here. </dd>
</dl>
Content of one of the metafields on the front-end is displayed as follows:
{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Included in this greenhouse is the following:"}]},{"listType":"unordered","type":"list","children":[{"type":"list-item","children":[{"type":"text","value":"Door 1"}]},{"type":"list-item","children":[{"type":"text","value":"Door 2"}]},{"type":"list-item","children":[{"type":"text","value":"Door 3"}]}]}]}
Can anyone help as to how I can display this correctly?
Thank you so much
Solved! Go to the solution
This is an accepted solution.
OK, I am going to answer it myself: just add | metafield_tag after the metafield name like this:
{{product.metafields.custom.tab_3_content | metafield_tag }}
Hello @GH2023 ,
Please let me know what Content-Type your Metafield is.
Hi, thank you so much for getting back to me. I found a YouTube video describing my exact problem and a solution for it, which I have documented on this thread.
Kind regards
This is an accepted solution.
OK, I am going to answer it myself: just add | metafield_tag after the metafield name like this:
{{product.metafields.custom.tab_3_content | metafield_tag }}
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025