Skip to main content

Embeds

This section of the documentation contains information about the examples of different types of embed blocks available in the Codex editor. You can then view more information about attributes of each embed below the examples.

Facebook embed

{
"type": "codex_facebook_embed",
"attrs": {
"blockId": "blockId",
"src": "https://facebook.com/example",
"align": "left",
"caption": null
},
"content": [],
"contentHTML": "-"
}

YouTube embed

{
"type": "codex_youtube_embed",
"attrs": {
"blockId": "blockId",
"src": "https://www.youtube.com/example",
"videoId": null,
"caption": null,
"align": "left",
"width": "50%"
},
"content": [],
"contentHTML": "-"
}

Instagram embed

{
"type": "codex_instagram_embed",
"attrs": {
"blockId": "blockId",
"src": "https://www.instagram.com/example",
"align": "left",
"includeCaption": true,
"caption": ""
},
"content": [],
"contentHTML": "-"
}

Twitter embed

{
"type": "codex_twitter_embed",
"attrs": {
"blockId": "blockId",
"src": "https://twitter.com/example",
"align": "left",
"caption": ""
},
"content": [],
"contentHTML": "-"
}

Spotify embed

{
"type": "codex_spotify_podcast",
"attrs": {
"blockId": "blockId",
"src": "https://open.spotify.com/example",
"align": "left",
"width": "50%",
"caption": null
},
"content": [],
"contentHTML": "-"
}

MallTV embed

{
"type": "codex_malltv_embed",
"attrs": {
"blockId": "blockId",
"src": "https://www.mall.tv/example",
"caption": null,
"align": "left",
"width": "50%"
},
"content": [],
"contentHTML": "-"
}

Vimeo embed

{
"type": "codex_vimeo_embed",
"attrs": {
"blockId": "blockId",
"src": "https://vimeo.com/example",
"caption": null,
"align": "left",
"width": "50%",
"video_id": null,
"aspectRatio": null
},
"content": [],
"contentHTML": "-"
}

Apple Podcast

{
"type": "codex_apple_podcast",
"attrs": {
"blockId": "blockId",
"src": "https://podcasts.apple.com/example",
"align": "left",
"width": "50%",
"caption": null
},
"content": [],
"contentHTML": "-"
}

Google Podcast

{
"type": "codex_google_podcast",
"attrs": {
"blockId": "blb9487b8d81184df19c69",
"src": "https://example",
"align": "left",
"size": "small"
},
"content": [],
"contentHTML": "-"
}

Generic iFrame

{
"type": "codex_iframe",
"attrs": {
"blockId": "blockId",
"src": "https://www.example.com/",
"align": "left",
"width": "50%",
"height": 300,
"scrolling": "auto",
"caption": ""
},
"content": [],
"contentHTML": "-"
}

type

A string that represents the type of embed block.

content

An array of objects that represents the content of the block.

attrs

An object that represents the attributes of the block.

attrs.blockId

A string that represents the unique block ID of the embed. Every embed type contains this attribute.

attrs.src

A string that represents the unique block ID of the embed. Every embed type contains this attribute, except for the Google Podcast embed.

attrs.align

A string that represents the embed alignment. This value can be left, center, or right. Every embed type contains this attribute.

attrs.caption

A string that represents the caption of the embed. Every embed type contains this attribute, except for the Google Podcast embed.

attrs.width

A string that represents the width of the embed. The YouTube, Spotify, MallTV, Vimeo, Apple Podcast, and Generic iFrame embed contain this attribute.

attrs.videoId

A string that represents the Id of the video. The YouTube and Vimeo embed contain this attribute.

attrs.includeCaption

A boolean that indicates whether the caption will be included in the embed. The Instagram embed contains this attribute.

attrs.aspectRatio

A string that represents the aspect ratio of the video. The Vimeo embed contains this attribute.

attrs.height

A number that represents the height of the embed block. The Generic iFrame embed contains this attribute.

attrs.scrolling

A string that represents the scroll type of the embed block. The Generic iFrame embed contains this attribute.

attrs.size

A string that represents the size of the Google Podcast. The Google Podcast embed contains this attribute.

contentHTML

A string that represents the generated HTML of the block.