I have editors on multiple pages on my site, many with different settings, such as toolbars. What I was hoping to do is have all my common settings in one configuration file and then have settings for each type of editor stored in individual config files. I don't want to specify setting in-page, since several instances will have exactly the same settings.
I tried putting multiple toolbar definitions in the global config.js:
Then I have a custom config file called instance1.js which looks like:
Then in my page, I do this:
When I do this, I get the error:
"u is undefined" at line 66 of ckeditor.js
If I remove the following from instance1.js the error goes away:
It seems that as soon as I specify a custom config in-page, the settings in the global config.js are completely ignored, instead of cascaded.
I also tried putting all of the toolbar settings in baseConfig.js and changing my instance1.js to:
It seems like this just completely ignores the second line where I set the toolbar.
Can someone tell me what I am missing here? Or is there no way to actually cascade settings, and I need to duplicate all my common settings in all of my custom config files? Thanks.
I tried putting multiple toolbar definitions in the global config.js:
CKEDITOR.editorConfig = function( config ) { config.toolbar_Bar1 = [ [ 'Cut'] ]; config.toolbar_Bar2 = [ [ 'Copy'] ]; config.toolbar_Bar3 = [ [ 'Paste'] ]; };
Then I have a custom config file called instance1.js which looks like:
CKEDITOR.editorConfig = function( config ) { config.toolbar = 'Bar1'; };
Then in my page, I do this:
CKEDITOR.replace( 'EditorArea', { customConfig : 'instance1.js' });
When I do this, I get the error:
"u is undefined" at line 66 of ckeditor.js
If I remove the following from instance1.js the error goes away:
config.toolbar = 'Bar1';
It seems that as soon as I specify a custom config in-page, the settings in the global config.js are completely ignored, instead of cascaded.
I also tried putting all of the toolbar settings in baseConfig.js and changing my instance1.js to:
CKEDITOR.editorConfig = function( config ) { config.customConfig = "baseConfig.js"; config.toolbar = 'Bar1'; };
It seems like this just completely ignores the second line where I set the toolbar.
Can someone tell me what I am missing here? Or is there no way to actually cascade settings, and I need to duplicate all my common settings in all of my custom config files? Thanks.
Re: Cascading customConfig settings
I had a similar issue, returning the same "u is undefined" error.
After running some test I found out this error gets thrown when you specify a config.toolbar name and then the corresponding toolbar array doesn't exist.
in your case calling config.toolbar = 'Bar1'; while config.toolbar_Bar1 is not there.
I've also found out that the config.js in the base dir doesn't get loaded automatically.
the ting that should work for you is:
file: instance1.js
file: yourpage.html
make sure the path here is correct.
hope this helps,
Tedge
Re: Cascading customConfig settings
The default value for customConfig is <CKEditor folder>/config.js as explained in http://docs.cksource.com/ckeditor_api/s ... stomConfig
So when you specify a different value in the instance creation, that file won't be loaded, but if you specify in your file that it must load another file that should work.
So if you put in your file