Of the two major configuration files, 'ckeditor.config.js' and 'ckeditor.styles.js', there are two separate mechanisms for determining which one to use for any particular CKEditor profile.
ckeditor.styles.js can be loaded from the CKEditor module, from the admin theme, or from a custom tokenised path using a select and text field combination.
ckeditor.config.js however can only be loaded from the CKEditor module, or from the admin theme.
Can we have the same options provided for determining the path to ckeditor.styles.js available for ckeditor.config.js too?
FWIW (and this should, I suppose, be registered as a separate issue but I've seen it posited as a "solution" to the above) the "Custom javascript configuration" option doesn't appear to be anything of the sort, and attempting to use the below fragment leads to a broken editor by rendering the path to the ckeditor.config.js as a stripped-down URL encoded version of the text after the "=" character:
customConfig = Drupal.settings.basePath + 'themes/MyTheme/ckeditor.config.js';
which looks for the JS file at "/modules/ckeditor/ckeditor/Drupal.settings.basePath%20+%20'themes/MyTheme/ckeditor.config.js" (sic)
The following works as expected:
customConfig = '/themes/MyTheme/ckeditor.config.js';
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | ckeditor_config_path.patch | 5.96 KB | tangent |
| #2 | global_profile.png | 75.79 KB | tangent |
| #2 | profile_toolbar.png | 40.25 KB | tangent |
| Screen shot 2010-08-19 at 2.13.20pm.png | 31.82 KB | bluematt | |
| Screen shot 2010-08-19 at 2.12.51pm.png | 39.25 KB | bluematt |
Comments
Comment #1
milesw commented+1 for this feature. I'm often using an existing admin theme like Rubik, so adding the config there does not make sense. Ideally I would be able to store ckeditor.config.js with my main site theme.
Comment #2
tangent commentedAllowing the ckeditor configuration to be modified, outside of the module directory, is essential for version controlled installations.
The current option of loading an alternate configuration file is problematic for several reasons.
I propose to add an option to the global settings which captures a custom path for ckeditor.config.js.
Attached is a first run at a patch which implements such a setting.
The patch changes some of the field descriptions to better explain how to create a custom configuration.
Comment #3
tangent commentedForgot to change status
Comment #4
tangent commentedCan someone please comment on my patch? I'd like to gauge if my approach is reasonable or if I will have to fork the module locally so future module updates won't destroy my solution.
Comment #5
jcisio commentedI didn't review this patch, but currently there is an option "Load ckeditor.config.js from theme path". In my site, I put both ckeditor.config|style.js in my theme folder and it works.
Comment #6
tangent commented@jcisio, I explained in comment #2 why the theme path option is insufficient.
Comment #7
jcisio commented#6 I'm using Garland in admin and my custom theme for "frontend", and it currently works in my frontend. It's bizzare, huh?
Comment #8
tangent commented@jcisio, my patch attempts to offer a more intuitive (for typical site builders) and rational (content editor settings are not theme related) solution. The help text changes may not be perfect but discussion can resolve that. There may be an existing, hackish, solution but it is far from ideal. I am happy to continue working on the patch to bring it to an ideal state if current maintainers lack the time to do anything further than commit it.
Comment #9
plebe commentedI'm so +1 on this. I've been trying to find a way to specify, just as you say, a unique config file for each profile in CKEditor. Each profile can be assigned a unique role. This means that I can have a profile for each role which specifies unique file paths, template snippets, styles for the editor, and anyhing else specific to that role.
This would be super powerful. Can this be done now any other way? I tried adding a custom config path to the bottom textarea of each profile, but some commands just don't work in that box.
Comment #10
tstackhouse commentedSubscribing.
Comment #11
tangent commentedI just updated CKEditor to 6.x-1.4 and now my customConfig path no longer works. This feature is now critical or this regression needs to be fixed. For those interested, below are my custom javascript settings to load the editor configuration from the "default" site path.
Comment #12
dczepierga commentedPls try to update to last DEV version and write than does it help or not... It was some bugs in 6.x-1.4 and all we fix in last DEV version.
Greetings
Comment #13
tangent commentedSorry for the delay but I just updated to -dev and the bug is still present.
In ckeditor 6.x-1.4 the contents of my custom javascript configuration was this.
After updating this results in the editor loading the default profile. I tried adding semi-colons as they now seem to be required but that causes the editor to fail to load entirely. It looks like the "customConfig" line no longer works because only commands that begin with "config." are caught by the new regex pattern.
Comment #14
mkesicki commentedComment #15
1kenthomas commentedSeem to have same "bug" here. (Personally: Forking to custom version of module in sites/example.com/modules/ckeditor/~ until worked out.) Thanks!
Comment #16
tangent commentedI'm sticking with ckeditor 1.3 until this regression is fixed. I don't have time to roll a patch to fix this at the moment.
Comment #17
tangent commentedAs of 6.x-1.8 it is possible to configure a custom toolbar and most other custom features in the js_conf field. However, I still have a need to alter CKeditor event behavior and this can only be done, without hacks, by using a customized ckeditor.config.js file which is no longer possible. Some modifications which I need to do are:
I was using the CKEDITOR.on() method in ckeditor.config.js to do this.
Removing the ability to use the "customConfig" parameter in js_conf and not providing this ability somewhere else is a regression that must be fixed.
Comment #18
mkesicki commented@tangent,
I am not sure if this is what you want to achieve, but try add
config.customConfig='path/to/your/ckeditor/custom/config.js';in "Custom JavaScript configuration" option of CKEditor profile.In this way you should load your customized config (http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.cust...) to CKEditor. I tried this solution with your attached code at http://drupal.org/node/887896#comment-5214794 and it works. Please check and write if this is what you want to achieve.
Comment #19
tangent commented@michal_cksource,
That option does indeed work. I believe I had tried that syntax in the past and it didn't work but it does work now. This option is not for the faint of heart and should be well documented if it will remain like this but it does work. Thanks for the tip.
Comment #20
mkesicki commented@tangent
I think this option can stay in this way. Remember that only more 'advanced' user will try to use something like this. Of course documentation can be better.