I am using Wygwam as WYSIWYG-editor. Now when I add a template variable or template partial inside an html-tag in a field which uses Wygwam it will be removed when switching from source to visual.

That means I enter e.g. in the source-code something like

<a href="test1" {variable1}>test1</a>

and after switching to Wysiwyg-layout the code changes to

<a href="test1">test1</a>

Note that the variable outside the tag still is there (variable2), but the one inside the a-link is gone (variable1).

The "restrict allowed HTML"-setting is off, see image:

CKEditor-config: Restrict allwed HTML is off

Possibly the CKEditor-setting "extraAllowedContent" could help me, but I am not sure and do not understand how I could change this setting.

CKEditor-setting: extraAllowedContent

Thanks for any help with this!

2 Answers 2


I think Wyvern (an other wysiwyg) can "process" the ee variables and partials. https://expressionengine.com/add-ons/wyvern

  • That would be neat. I checked documentation (docs.reinos.nl/wyvern) and it lists Low Variables, at least.
    – jphansen
    Commented Nov 24, 2020 at 16:04
  • Actually I talked to Rein (reinos.nl) and he assured me that Wyvern could process variables the way I intended. So this answer pushed me to the solution, thanks!
    – BNetz
    Commented Jan 1, 2021 at 0:35
  • Happy to help! Thanks
    – Benoit L
    Commented Jan 2, 2021 at 4:58

I don't think template variables are supposed to be rendered inside WYGWAM to begin with. I just ran a test and the variable name {tp_test} was retained literally from Source to Preview, and then in an actual web page, as well.

EDIT: You can use https://expressionengine.com/add-ons/allow-ee-code to allow template code in fields.

So chasing if/when WYGWAM erases it is kind of a red herring. But yes the extraAllowedContent would fix that. e.g., I have "i[*]" to allow everything inside <i> tags (FontAwesome).

  • I tried this and entered a[*] into an extraAllowedContent-setting, but this did change nothing. Also I am not sure if the extraAllowedContent plays a role when you have set "restrict allowed html" to "no" as shown in my question.
    – BNetz
    Commented Nov 25, 2020 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.