Oh joy of wysiwyg editors, that are going to alter the html you have so carefully typed to be compatible with all the mail clients in their glorious diversities...

For some mailings at least, I'd like to be able to tell the editor to stay home and let me type my html directly, as the W3C gods intended. Unfortunately, the setting to change the editor (CKEDITOR, tinyeditor or textarea) doesn't seem to be taken into account in civimail (or ab testing)

Is this a cache that I couldn't clear after the change (it worked fine for "normal" mail sendings, just civimail that ignored the new setting)?

Is there a bit of code to hack to make it work?

  • Did you manage to achieve what you wanted? Any of the answers helped you?
    – thoni56
    Commented Feb 23, 2016 at 10:43

5 Answers 5


Editing markup

The editor includes a "Source" button which can be used to edit markup directly.

Using <textarea>

Upgrade to v4.7!

In depth

CiviCRM v4.6 includes a pure-JS rewrite of the CiviMail frontend. Unfortunately, the old WYSIWYG abstraction couldn't adapt well to pure-JS, so CiviMail in v4.6 only supports one editor. (Specifically, CiviMail uses the crmUiRichtext directive which is hardcoded to CKEditor.) However, all other screens still use the old WYSIWYG abstraction.

v4.7 cleans things up by switching to a pure-JS WYSIWYG abstraction. The core ships with only two options (CKEditor and <textarea>). However, you can write an extension that defines alternatives (e.g. https://civicrm.org/extensions/tinymce ).

See also: https://civicrm.org/blogs/colemanw/big-changes-wysiwyg-editing-47

  • 3
    hey, the source button allows you to edit the source, but the editor is still going to alter what you typed after you save it
    – Xavier
    Commented Dec 6, 2015 at 9:57

I know that's not exactly what you requested, but you might consider disabling the character escaping behaviour of the editor altogether.

Here is how.


This doesn't answer the question neither but it might help.

What I do to prevent CKEditor from striping/modifying the markup is disable CKEditor's Advanced Content Filter (ACF), editing the config.js file in /path/to/civicrm/packages/ckeditor, more info here.

config.extraAllowedContent = 'html;head;body;span;ul;li;table;td;style;*[id];*(*);*{*}';

[ ] // for attributes

{ } // for styles

( ) // for classes
  • I can't get this to work. I have pasted the exact js into packages/ckeditor/config.js but that does not seem to affect the mailings editor. I'm on 4.7.
    – thoni56
    Commented Feb 23, 2016 at 10:44
  • There's also the bower_components/ckeditor/config.js. When is that used?
    – thoni56
    Commented Feb 23, 2016 at 10:46

The problem seems to be that the CKeditor configurator at Administer->Custom data and Views->Display persists the editor configuration in a file in /media/civicrm/persist/crm-ckeditor-config.js and that file is overwritten each time you touch the configurator.

It looks like CiviCRM does this by replacing the reference to the default config.js (in packages/ckeditor with a reference to the persisted config. So any configuration placed here is simply never read.

So I can't see any solution to this problem until there is a way to insert custom config directives into that persisted config. (Except for re-adding it every time you re-configure CKEditor...).

  • your post doesn't answer the original question, you might want to ask a new question explaining your problem/issue. Regarding your note and previous comments, have a look at at Tim Otten's answer below and also read civicrm.org/blogs/colemanw/big-changes-wysiwyg-editing-47 in the comments of that post you'll find a tip on how you would load your own config.js file using hook_coreResourceList in an extensions which seems to answer your questions
    – Andrei
    Commented Feb 23, 2016 at 12:42
  • 1
    Thanks for that thin thread to follow. I've removed my frustrated ranting, As my answer now stands I think it helps readers to understand that beyond implementing their own Civi-extensions there is currently no way to do what the OP asks, right?
    – thoni56
    Commented Feb 23, 2016 at 20:24
  • And FWIW, I think Tim Otten's answer is not explaining the situation very clearly. Perhaps you, @Andrei could supply a clearer answer based on your comment.
    – thoni56
    Commented Feb 23, 2016 at 20:29
  • if you think Tim Otten's answer is not explanatory enough, perhaps you could suggest an edit so he can update it. Regarding you previous comment I guess the answer is No, I don't think is possible to disable CKEditor on a per component basis (CiviMail) without affecting the whole system, 'normal' emails, activities, etc... So you either go with CKEditor, Textarea or an Extension to implement another WYSWIG editor of your choice.
    – Andrei
    Commented Feb 24, 2016 at 1:57
  • Maybe I was reading too much into the question... I found a very clear answer to the question I probably wanted to ask, which is consistent with your first comment, at civicrm.stackexchange.com/a/4526/354,
    – thoni56
    Commented Feb 24, 2016 at 14:11

We had a similar problem of the CKEditor config not 'taking' on a multisite / Aegir system and after much work solved this.

Our solution is detailed here: Is this a bug - [civicrm.files] variable

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.