Insert an HTML embed into metaobject template

Topic summary

A user seeks to embed Flipbook HTML scripts into metaobject templates, allowing clients to add these as content items. They’ve added the HTML code as a multi-line field in the metaobject but cannot render it in the template.

Solution provided:

  • Create a metaobject definition with a single-line text field
  • Add the HTML embed code to that field
  • Reference the metaobject in a custom Liquid section using: {{ shop.metafields.custom.YourEmbedHtmlAsSingleTextLine }}
  • This approach successfully renders the HTML embed (demonstrated with a YouTube embed example)

Alternative approach:

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

I’m hoping to get some help with adding an HTML embed field into a metaobject template. Idea is that client will be able to add Flipbook embed scripts as content items/metaobjects.

I currently have this added to the metaobject as a multi-line field, but can’t see a way to have the metaobject template pull this into the template and render the HTML code.

Thanks in advance.

Hey Rhythmdigital,

I was able to render this YouTube embed from a metaobject single line field.

The way I did it was creating a test metaobject definition with a single single-text-field.

Then created a metaobject, adding the embed code into that single text field

Then in my section’s code, I just referenced it, then it rendered the HTML embed

Hope this helps!

hello, for some reason I don’t know, link metefiedl direct from the custom of the theme does not work/ The workarround, is to have a custom liquid section/ block, and enter {{ shop.metafields.custom.YourEmbedhtmlAsSingleTextLine }}
If your theme does not have custom liquid section, you can add Fancy Sections App