Templating the Embed field
The Embed field will let content authors paste an oEmbed supported service resource URL (YouTube, Vimeo, Soundcloud, etc.), and add the embeded content to your website.
This article assumes that you have saved the document object in a variable named document as shown in the Retrieve the document object page.
Access the HTML of an Embed
Here's an example of how to access the HTML for an Embed field. In this case, the Embed field has an API ID of social_embed. Note that the HTML will be retrieved in a string, so you will most likely need to escape the HTML from the string.
const embedHtml = document.social_embed.html
Was this article helpful?
Can't find what you're looking for? Get in touch with us on our Community Forum.