I’m building a site and want to add an external calendar to each of my collection pages. The calendars are embedded using a small piece of code, effectively loading an iframe.
I have tried to enter the embed code into the collection fields using most of the field elements, but it doersnt work.
Any idea if its possible to add ‘embed’ code into a collection field?
This is an example of the type of code that I am trying to paste into a collection field. The collection page doesn’t allow me. Maybe there’s another way?
I can see in chrome’s network panel that the script loaded.
However, this seems pretty limited. I tried putting actual javascript console.log('test');, and it wouldn’t work, because webflow is escaping some special characters:
You can save the src of the script in a collection text field. Then on the page you place an embed element in the collection list, and insert the src from the collection in the script tags:
The src will just show on the website, if you forgot to put it in src tags in the embed element. I did it like described and the script loaded.
But be aware that webflow escapes certain special characters. If the code still just shows on the website, inspect it and see if you find escaped characters in the code.
But with the concrete example you gave it works.
Glad you got this sorted - a bit late, but embedding code in collections works brilliantly in Webflow. I have produced customer dashboard pages made up of code from Google Data Studio and Pingdom (website health) - both live reports and specific to that customer.
The customers love it and I produce it using a CRM called Pipedrive via Zapier - pretty much automatic web page production!
I am making a drop down booking page where you clink and when it drops down you see Calendly.
Now I like a different Calendly code embedded for each heading because the services are different. I am able to embed the code into the drop down and it works perfectly. The only problem is that I need the code to be different for every heading. When I put the embed, it automatically fill all the headings with the same code.
As someone who creates weekly playlists for friends and family. I was running into the same issue. The issue is with creating a Text Field in your collection list settings and then trying to use that text within an embed added to the collection page template. You should instead add a Rich Text Field in your collection list settings. Then put the embed code in directly, then on the collection page template add a Rich Text element and source the Rich Text Field.