0

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>
<p>test{variable2}</p>

and after switching to Wysiwyg-layout the code changes to

<a href="test1">test1</a>
<p>test{variable2}</p>

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!

0

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

| improve this answer | |
0

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).

| improve this answer | |
  • 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 Nov 25 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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