How to Render Rich Text from Metaobject with Proper Formatting?

I’m trying to render rich text from a metaobject using Shopify’s input settings. However, the rich text formatting does not seem to apply.

Here’s the code I’m using:

{{ item.body.value }}

Result:
{“type”=>“root”, “children”=>[{“type”=>“paragraph”, “children”=>[{“type”=>“text”, “value”=>“Metaobject rich text block”}]}]}

{{ item.body.value | metafield_tag }}

Result:
Liquid error: metafield_tag can only be used with a metafield drop

Since metafield_tag only works with metafields, it doesn’t seem applicable to metaobjects.

What’s the recommended way to render and format rich text from a metaobject? Are there any best practices or additional filters that should be used in this case?

Thank you in advance!

Can you please remove the .value and try that? So try the following:

{{ item.body | metafield_tag }}
1 Like

Bro, you need to remove .value

This is the right way to render rich text

{{ item.body | metafield_tag }}
1 Like

Maybe check the replies first dude :wink:

Oh! Thank you. I assumed that using value for retrieval was the default, but it wasn’t.
The issue has been completely resolved.
@Sam_Tim Thanks, too!

1 Like

Always welcome bro, I am here to help you