Streaming live at 10am (PST)

Add Dynamic Embed to a Blog Post


#1

Hello,

Id like to add a dyamic embed that is unique to each post in a blog entry. An example of the embed is:

<iframe width="100%" height="520" frameborder="0" src="https://el-guapo.carto.com/builder/5bdaba70-5b1a-43a5-a6d5-4324c96612b0/embed" allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe>

and each entry would have a unique embed. How can this be achieved?

Thanks!
k.


#2

Hi @kalincan, one thing that can be done is to add a custom code embed to the page, and then paste in the snippet you shared above and save the embed.

Next, create a text field in your collection and give that field a name that will easily identify the field as being the unique url you need to use for each post and save the collection. Edit your items with a unique url for each collection item.

From the looks of the code snippet, this should probably be this part:

https://el-guapo.carto.com/builder/5bdaba70-5b1a-43a5-a6d5-4324c96612b0/embed

Next, go to the embed you saved earlier on the page, and select the url in the snippet, and insert the url field from the CMS.

After updating the embed, save and republish the site, and now each collection item having a url added to the collection, will get a different iframe content based on the url added to each individual item.

I hope this helps.


#3

Thanks so much, this works perfectly!

k.


#4

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.