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.
Here's an example of how to integrate the Embed field into your templates using the asHtml() method.
Copy
<div>${document.getEmbed("page.embed").asHtml()}</div>
The following shows how to retrieve the Embed type from an Embed field using the getType() method.
Copy
document.getEmbed("page.embed").getType()
// For example this might return: video
The following shows how to retrieve the Embed provider from an Embed field using the getProvider() method.
Copy
document.getEmbed("page.embed").getProvider()
// For example this might return: YouTube