Streaming live at 10am (PST)

HTML Embed - Strange behaviour with CMS Collection

Dear Webflow community,

I’m experiencing an issue with HTML embed on a site I’m working on.

I created a CMS collection where I group information about different insurances, and I embedded on each insurance a different custom code in order to display a calculator. To reach this goal, I set a condition for each HTML embed in which I say only to display the embedded widget on the related CMS item (they are 5 altogether).

One of them is working kind of fine (the page loads a bit unevenly, but since the whole site is a test I’m OK with it at the moment), but all the others load partly, and the container keeps expanding and shrinking. What am I missing there?

Here the links to the different pages affected:

When I started working on it (an hour ago or so), it was working fine. Then things started going south and I don’t seem to be able to make it work again…


Here is my site Read-Only link

Thank you in advance for taking the time to help me through this!
Best
Chiara

I don’t know what’s happening, but, by doing what you do, you have 6 scripts running at the same time. they’re just hidden, but they’re running.

To simplify, try to do this: create a text field in your collection, or an option field, and use the values surch as ‘buv’ ‘rs’ or ‘phv’ (basically the only portion of your code that changes accross all your embed components).

Then use the dynamic properties of the embed box to pupulate them with a variable: click on +Add Field and select your new field. I simulate it here with your ‘Short ID’ field just for you to get a visual explanation, but you gotta make sure the field gets only lowercase data or else you’re gonna have code issues.

1 Like

Hi Vincent,

thank you so much, great solution!!

It worked wonderfully, thanks for spotting the consistencies in the script and pointing out a (WAY) more logical way to proceed :slight_smile:

Have a nice day!
Chiara

1 Like

Did it fix the bug you had? if yes, great, there was a possibility the scripts were all fighting against each others and that the only one working was the first, or the last, in order on the page.

It did, now it works perfectly!

It totally makes sense that the scripts were competing with each other, and your solution brought peace to the page :slight_smile:

I love that! :smiley:

1 Like