# Code as Dynamic Web Content

**URL:** <https://forum.mautic.org/t/code-as-dynamic-web-content/20509>\
**Category:** Mautic 3 - Install/Upgrade Support\
**Created:** [August 16, 2021, 12:59pm UTC](https://forum.mautic.org/t/code-as-dynamic-web-content/20509 "2021-08-16T12:59:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nsomaru](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nsomaru/32/2801_2.png) [@nsomaru](https://forum.mautic.org/u/nsomaru)\
**Post date:** [August 16, 2021, 12:59pm UTC](https://forum.mautic.org/t/code-as-dynamic-web-content/20509/1 "2021-08-16T12:59:30Z")

</div>

**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?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [August 16, 2021, 1:27pm UTC](https://forum.mautic.org/t/code-as-dynamic-web-content/20509/2 "2021-08-16T13:27:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nsomaru](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nsomaru/32/2801_2.png) [@nsomaru](https://forum.mautic.org/u/nsomaru)\
**Post date:** [August 16, 2021, 9:02pm UTC](https://forum.mautic.org/t/code-as-dynamic-web-content/20509/3 "2021-08-16T21:02:58Z")

</div>

Thanks @joeyk

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

---

<div class="post-metadata">

**Author:** ![ericgr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ericgr/32/5505_2.png) [@ericgr](https://forum.mautic.org/u/ericgr)\
**Post date:** [April 25, 2022, 1:06am UTC](https://forum.mautic.org/t/code-as-dynamic-web-content/20509/4 "2022-04-25T01:06:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [April 25, 2022, 8:51am UTC](https://forum.mautic.org/t/code-as-dynamic-web-content/20509/5 "2022-04-25T08:51:02Z")

</div>

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.
