Code as Dynamic Web Content

Your problem
My problem is :

I’m using dynamic web content with Wordpress. It works fine.

I want to embed an iframe and script tag in dynamic web content but this stuff is being stripped even when I add it in the code view.

If I add it in the text view, my code is escaped, as one would expect.

Steps I have tried to fix the problem :

Paste the code into the code section of the WYSIWYG editor. It does not save the code I paste.

Edit:

I’m contemplating just putting an empty ‘div’ or ‘p’ into the dynamic web content and then injecting the dynamic content I want in the actual slot (an iframe and a script) on the host page via js, but I’d prefer to have the more elegant solution of including everything in Mautic.

Is it possible?

As far as I know you can’t. Sorry.

Thanks @joeyk

I’m going to create a different page for each variation.

I’m having this same problem, but with even basic html. Just trying to add a ‘div’ tag with a style on it to set a background color just to ‘jazz’ it up a bit. And it gets stripped every time. This is very limiting in terms of what can be accomplished with DWC.

Use the twig templates plugin.
You can write as much code as you want inside the twig template, then you can add one line into the DWC: {twigtemplate=12} for example. Boom, magic.

1 Like