Answers.Body: <p>We had the same problem on a multisite / Aegir system and after much work solved this.</p>
  
  <p>Our solution is detailed here: <a href="https://civicrm.stackexchange.com/questions/17355/solved-is-this-a-bug-civicrm-files-variable">Solved: Is this a bug - [civicrm.files] variable</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-01T10:08:15.097Z
Answers.LastActivityDate: 2017-07-04T17:26:30.450Z
Answers.LastEditDate: 2017-07-04T17:26:30.450Z
Answers.UserDisplayName: Davy Ivins
Answers.Body: <p>To answer your question about how to modify CKEditor's config.js:</p>
  
  <h2>In 4.6</h2>
  
  <p>You need to "hack" the config.js file within CiviCRM itself (packages/ckeditor/config.js). Editing this file will modify all instances of CKEditor in CiviCRM (angular and quickform add a few additional settings related to file uploads but they do both respect that file). If you don't see your changes right away, clear your browser's cache. Note that this file will be overwritten with every upgrade.</p>
  
  <h2>In 4.7</h2>
  
  <p>4.7 adds a <a href="https://civicrm.org/blogs/colemanw/big-changes-wysiwyg-editing-47" rel="nofollow noreferrer">GUI in Display Preferences</a> to modify plugins and button groups, and this will generate at least one config file named <code>crm-ckeditor-default.js</code> in your <code>files/civicrm/persist</code> directory (more files will be created if you click other tabs e.g. for CiviMail or CiviEvent). This file won't be overwritten during upgrades, but will be overwritten if you make changes from the GUI. There is also a new <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_coreResourceList" rel="nofollow noreferrer">hook_civicrm_coreResourceList</a> which you can use to specify a different config file depending on whatever logic you want like current page, current user, etc.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-27T02:55:32.240Z
Answers.Text: For 4.6 - would there be a way to override the config.js file via an extension, or is it too hard-coded?
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-27T16:11:20.840Z
Answers.Text: There might be a way to hack around it, like have the extension push some js onto the page that overrides ckeditor settings. It might be a pita though.
Answers.UserDisplayName: Coleman
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-01T13:20:47.330Z
Answers.Text: If it helps, I wrote some stuff for adding fonts, and just found this thread. It basically is an example for 4.7 to what you are proposing here. Can be found here: https://civicrm.stackexchange.com/questions/22260/additional-fonts-ckeditor/22957#22957
Answers.UserDisplayName: Phil_B
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-07T14:53:24.570Z
Answers.Text: Thanks coleman, this answers the original question (which spawned a million others, sorry).
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-07T15:07:23.380Z
Answers.Text: I've split out the other question to try and keep this one tidy.
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-07T14:45:25.490Z
Answers.LastActivityDate: 2018-03-02T00:43:53.287Z
Answers.LastEditDate: 2018-03-02T00:43:53.287Z
Answers.UserDisplayName: Coleman
Body: <p><strong>The question</strong></p>
  
  <p>Where/how can I override the default CKEditor configuration files in CiviCRM?</p>
  
  <p><strong>Original issue / follow-up question</strong></p>
  
  <p>We have a custom email template that uses <code>&lt;html&gt;, &lt;head&gt;, &lt;body&gt;</code>. When using CKEditor, if you paste the template in 'Source' and then flip back out of the source view the tags mentioned above are stripped out. This is because the CKEditor default setting is to strip these tags.</p>
  
  <p>I've opened a  follow-up question here: <a href="https://civicrm.stackexchange.com/questions/4528/">How can I use &lt;html&gt;, &lt;head&gt;, &lt;body&gt; tags in a mailing?</a></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-07T13:04:29.343Z
Comments.Text: Note: the fullPage config option is not the solution - this adds the <html><head><body> tags everywhere rather than just not stripping them out.
Comments.UserDisplayName: John
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-07T13:19:39.020Z
Comments.Text: I've modified config.js before and it's been reflected in Civi, so that *should* work.
Comments.UserDisplayName: Andrew West
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-07T13:23:20.217Z
Comments.Text: Hi, unfortunately config.js doesn't seem to get included, and there are two other places that CKEditor gets config defined: in ang\CRMUi.js and also in QuickForm package for textareas. So there's at least two different approaches going on :P
Comments.UserDisplayName: John
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-07T13:51:38.727Z
Comments.Text: @AndrewWest Perhaps the config.js only affects CKEditor instances in the QuickForm approach, but not the Mailing interface which is loaded via angular...
Comments.UserDisplayName: John
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-07T14:39:47.647Z
Comments.Text: ah, that's possible - the changes I needed were when generating PDFs, so I didn't hit the mailing interface. Sorry to mislead!
Comments.UserDisplayName: Andrew West
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-07T14:58:17.533Z
Comments.Text: @AndrewWest not misleading, all valuable!
Comments.UserDisplayName: John
Tags: <civimail><tags><wysiwyg><ckeditor>
Title: How do I override the default CKEditor configuration?
ThreadText: # How do I override the default CKEditor configuration?
  
  (Asked by: username_0 on 2015-08-07)
  
  **The question**
  
  Where/how can I override the default CKEditor configuration files in CiviCRM?
  
  **Original issue / follow-up question**
  
  We have a custom email template that uses `<html>, <head>, <body>`. When using CKEditor, if you paste the template in 'Source' and then flip back out of the source view the tags mentioned above are stripped out. This is because the CKEditor default setting is to strip these tags.
  
  I've opened a follow-up question here: [How can I use <html>, <head>, <body> tags in a mailing?](https://civicrm.stackexchange.com/questions/4528/)
  
  **Tags:** civimail, tags, wysiwyg, ckeditor
  
  > **Comments:**
  > **username_0**: Note: the fullPage config option is not the solution - this adds the <html><head><body> tags everywhere rather than just not stripping them out.  
  > **username_1**: I've modified config.js before and it's been reflected in Civi, so that *should* work.  
  > **username_0**: Hi, unfortunately config.js doesn't seem to get included, and there are two other places that CKEditor gets config defined: in ang\CRMUi.js and also in QuickForm package for textareas. So there's at least two different approaches going on :P  
  > **username_0**: @username_1 Perhaps the config.js only affects CKEditor instances in the QuickForm approach, but not the Mailing interface which is loaded via angular...  
  > **username_1**: ah, that's possible - the changes I needed were when generating PDFs, so I didn't hit the mailing interface. Sorry to mislead!  
  > **username_0**: @username_1 not misleading, all valuable!  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2015-08-07. Score: 13 | Accepted answer
  
  To answer your question about how to modify CKEditor's config.js:
  
  ## In 4.6
  
  You need to "hack" the config.js file within CiviCRM itself (packages/ckeditor/config.js). Editing this file will modify all instances of CKEditor in CiviCRM (angular and quickform add a few additional settings related to file uploads but they do both respect that file). If you don't see your changes right away, clear your browser's cache. Note that this file will be overwritten with every upgrade.
  
  ## In 4.7
  
  4.7 adds a [GUI in Display Preferences](https://civicrm.org/blogs/colemanw/big-changes-wysiwyg-editing-47) to modify plugins and button groups, and this will generate at least one config file named `crm-ckeditor-default.js` in your `files/civicrm/persist` directory (more files will be created if you click other tabs e.g. for CiviMail or CiviEvent). This file won't be overwritten during upgrades, but will be overwritten if you make changes from the GUI. There is also a new [hook\_civicrm\_coreResourceList](http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_coreResourceList) which you can use to specify a different config file depending on whatever logic you want like current page, current user, etc.
  
  > **Comments:**
  > **username_0**: Thanks username_3, this answers the original question (which spawned a million others, sorry).  
  > **username_0**: I've split out the other question to try and keep this one tidy.  
  > **username_4**: For 4.6 - would there be a way to override the config.js file via an extension, or is it too hard-coded?  
  > **username_3**: There might be a way to hack around it, like have the extension push some js onto the page that overrides ckeditor settings. It might be a pita though.  
  > **username_5**: If it helps, I wrote some stuff for adding fonts, and just found this thread. It basically is an example for 4.7 to what you are proposing here. Can be found here: https://civicrm.stackexchange.com/questions/22260/additional-fonts-ckeditor/22957#22957  
  
  ---
  
  ### Answer by username_2 on 2017-03-01. Score: 0
  
  We had the same problem on a multisite / Aegir system and after much work solved this.
  
  Our solution is detailed here: [Solved: Is this a bug - [civicrm.files] variable](https://civicrm.stackexchange.com/questions/17355/solved-is-this-a-bug-civicrm-files-variable)
  
  
  ---
  
  