I’m trying to embed an Elfsight instagram widget using the CMS - each item in the collection will have it’s own unique widget, which I’m trying to display on the Collection page.
The embed div just seems to get spit out as text. This is the code - I’ve entered this as a Plain Text on the cms collection:
They give me a script, which I tried adding to the site footer, and to the Collection Page’s custom code: <script src="https://apps.elfsight.com/p/platform.js" defer></script>
Adding solution here because the suggested methods didn’t work or aren’t explained in enough detail to solve the problem, and because the solution was extremely straightforward.
The embed code needs to be placed in a Rich Text CMS element - within the Rich Text element you want to choose the CODE option (see image below) when adding the embed script to the element. This can then be dropped into the Collection Template page as Rich Text, and it will generate.
You should specifically say that you add a “rich text element” in the CMS, and then you add a “rich text element” in the page… it will ACT like an embed element. GREAT SOLUTION! THANKS @threehex!!
Yes, this is the problem. You can put Embed Code into a Rich Text field in the CMS… but when you go to the custom code section of the template, although it lets you choose fields from your CMS… it doesn’t allow you to select Rich Text Fiels - ironically, the ONLY fields in which you can actually paste code. What a clusterf*ck!
If anyone is still having trouble making Jeff’s code work for collection lists, double-check that the class name on your HTML embed matches what’s being called in the script. I spent more time debugging than I should have, only to realize the class I was explicitly told to name .custom-code actually needed to be .podcast-embed for the collection list script to work.
To be fair, Jeff does mention that you can change the ID, but the way it’s explained makes it easy to assume you should still be using custom-code for collection lists. Would’ve saved me a lot of time if it had been clearly spelled out that .podcast-embed was necessary instead.
Pretty ironic, considering we were told that if it didn’t work, we ‘obviously weren’t following instructions.’ Kind of condescending to scold people looking for a no-code solution only to have to write custom code for a basic function that should’ve been built-in to begin with.