When using an admin theme, the CKEditor module does not load custom versions of ckeditor.config.js or ckeditor.styles.js. For me, this manifests as a problem when editing blocks.

I have the CKEditor module configured with "Load ckeditor.config.js from theme path" set to "Yes" and a predefined path to ckeditor.styles.js to load custom styles for the styles combo.

This works fine when editing nodes, in both the display and admin themes, because I have elected not to edit content using the admin theme.

However, neither the custom toolbar specified in my theme version of ckeditor.config.js nor the custom styles specified in ckeditor.styles.js are loaded when I edit blocks, which are normally edited using the admin theme.

Comments

escoles’s picture

Category: bug » support
escoles’s picture

Solution: Copy the config file to the root of the admin theme folder. You just have to remember to sync them if you have to update the config file.

mephir’s picture

Status: Active » Fixed

If you have any lack of clarity about issue, feel free to reopen it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

AlanAtLarge’s picture

Status: Closed (fixed) » Needs review

Hi
I've tried various combination of Predefined styles and Predefined styles path.

Also I have copied ckeditor.styles.js and ckeditor.config.js files back and forth between the module and my theme path, and nothing I do has any impact on getting a style appear in the style dropdown box. I either have the default or a BLANK empty box.

And I've used all combination of the the placeholders I can think of: %h, %t, and %m, as well as regularly clearing cache in both the browser and under site performance.

I am using garland as my admin theme, and working on my own themes. All I want to do is be able to apply a few simple classes to img tags and so far spent a half a day on this.

Any help appreciated.....really appreciated.
Thanks
Alan

sydneyshan’s picture

Can a preference item be added to the Edit CKEditor profile screen to specify whether the ckeditor.config.js file is loaded from the Admin theme OR the default theme? I use an Admin theme (Garland) for all content editing, and don't want to add files to the base Garland directory due to upgrade issues (I'll loose track of where I've put all these files), or they'll be overwritten in an upgrade.

A solution needs to be implemented where the location of the ckeditor.config.js file can be nominated somewhere OTHER THAN the currently active theme OR the module's directory. Does one exist already, or does this need to be added to the Edit CKEditor profile screen?

gionnibgud’s picture

Hi you can add your custom ckeditor.config.js from any location.

I believe this could be quite a common issue when using the admin theme for content editing and the solution should be documented.

This is how I solved it.
Go to the Edit CKEditor profile screen and at the end of the page, in the custom javascript textarea, you can add this line:

customConfig = '/path-to-the-file/ckeditor.config.js';

Remember to clear your browser's cache before reloading the editing page.

borgo’s picture

If you need to use relative path. 'path-to-the-file' mentioned above is relative to ckeditor library directory. In my case ckeditor library is in sites/all/libraries/ckeditor

So I had to go like

customConfig = '../../themes/mytheme/js/ckeditor.config.js';

In most cases I suppose your ckeditor library is under module directory in sites/all/modules/ckeditor/ckeditor, then its

customConfig = '../../../themes/mytheme/js/ckeditor.config.js';

dczepierga’s picture

Status: Needs review » Closed (fixed)

I closed this issue, because it's not active over 3 months. Everything is written above.

nicholas.alipaz’s picture

Title: ckeditor.config.js and ckeditor.styles.js not loaded from theme path when editing under admin theme » Document adding custom ckeditor.config.js from custom or theme path
Version: 6.x-1.1 » 6.x-1.x-dev
Component: Miscellaneous » Documentation
Category: support » task
Status: Closed (fixed) » Active

This took a good deal of work to figure out. This should really be documented better in the README and include information about using an admin theme.

   8. Modify the ckeditor.config.js file to custom your needs (optional).
      Configuration options are available here: 
      http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html
      Developers documentation for CKEditor:
      http://docs.cksource.com/CKEditor_3.x/Developers_Guide
      In ckeditor.config.js you may define your own toolbars with selected buttons.
      WARNING: clear browser's cache after you modify any of the javascript files.
      If you don't do this, you may notice that browser is ignoring all your changes.
        a. IMPORTANT note when using admin themes:
           When using an admin theme where ckeditor may appear and a custom 
           ckeditor.config.js, the "Load ckeditor.config.js from theme path" 
           option may appear as though it does not work.  This is because the 
           module is attempting to load the ckeditor.config.js file from the 
           wrong theme's path.  The easiest and most customizeable solution is 
           to leave this option set to 'no' in the settings and use the text 
           area "Custom javascript configuration."  Set the path as follows:
             customConfig = '../../../libraries/ckeditor.config.js';
           This is a relative path from the location of your ckeditor library 
           directory.  Example setup:
             /sites/all/modules/ckeditor
             /sites/all/modules/ckeditor/ckeditor <-- library here
             /sites/all/themes/mytheme/ckeditor.config.js
           With the above structure, you should set the setting like this:
             customConfig = '../../../themes/mytheme/ckeditor.config.js';
1kenthomas’s picture

//subscribing.

1kenthomas’s picture

Does not seem to work as documented (above).

One really needs a system to confirm that the config file has been located and loaded, else this is a shoot in the dark.

Setting per-profile is fairly cumbersome, should only be an override-- need overall setting as in FCKeditor module.

1kenthomas’s picture

See http://drupal.org/node/887896; currently does not seem to be working at all in 6.x-1.5 forward.

jwilson3’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

As pointed out by the module maintainer (mkesicki) here #887896-18: Allow choice of ckeditor.config.js as per ckeditor.styles.js, the appropriate way to do this in Drupal 7 at least is with config.customConfig in the "Custom javascript configuration" textarea on the CKEditor profile config page in the Drupal admin UI.

  • In a custom module, with root-relative path. This works only when Drupal *not* installed in subfolder.
    config.customConfig = '/sites/all/modules/mymodule/ckeditor.config.js';
    
  • In a custom module, relative to the ckeditor library location, e.g. at /sites/all/libraries/ckeditor.
    config.customConfig = '../../modules/mymodule/ckeditor.config.js';
    
  • In a custom theme, relative to the ckeditor library location, e.g. at /sites/all/libraries/ckeditor.
    config.customConfig = '../../themes/mytheme/js/ckeditor.config.js';
    

Anyone using Drupal 6 version might try this solution as well.

nicholas.alipaz’s picture

jwilson3, this issue is 4 years old and for d6.

I guess your comment might help googlers, but doesn't help the conversation here much.

jwilson3’s picture

I hope it helps a googler, reading through your suggested edits to the documentation (which, by now, it's clear will never be added to the D6 version), was difficult from how the wrapping works, so IMHO, my comment *does* help the conversation. Sorry to inconvenience you by bringing up the dead. ;)

jvdkolk’s picture

jwilson3: I am a Googler and very happy with your comment :)

psiegel’s picture

Hello,

I am another happy Googler.

I use D7 and Ckeditor 1.7.7 and the issue of only looking at the root of the theme directory is still there. ckeditor.config.js is not found/ used when it is in a sub-directory of the theme (like theme/js).

I am using config.customConfig = '../../themes/bear_skin/js/ckeditor.config.js';

Any chance to get this solved or to have a variable %t with the current used them in order to replace bear_skin in the path?

Best,
Pascal

sammydigits’s picture

I wrote a quick blog post about how to use ckeditor.config.js to set default values in the image properties dialog:

http://blog.sam-thompson.info/drupal-and-ckeditor-setting-default-values...

Hope it helps someone.