I'm trying to place multiple CKEDITOR instances on the same page, each one loading a different config file. It works fine in FF, but in IE the config file from the last instance on the page is applied to all instances. Each instance has a unique base element name. I'm using the following code to add the instances, with the customConfig, width, and height values changing for each instance.
I can't just specify the settings from the config files on the page, because part of the config file is an oninstanceready call. The only way I've been able to make it work is to delay the initialization of each instance using setTimeout, but this is far from ideal. Any ideas?
CKEDITOR.replace( document.form1.elementName, { customConfig : customConfigFile.js', width : '500px', height: '200px' } );
I can't just specify the settings from the config files on the page, because part of the config file is an oninstanceready call. The only way I've been able to make it work is to delay the initialization of each instance using setTimeout, but this is far from ideal. Any ideas?
Re: Multiple instances with different config files in IE bro
And then when you actually do your separate instances, you'd do:
(The above text sets SimpleVersion as the default, but you could do it without.....)
Cheers.
Re: Multiple instances with different config files in IE bro
The solution given by libek is not one solution. I dont want have different toolbars, but different sizes. So the question is How we can use different ckeditor-textareas sizes in the same form?.
This is my code:
Without setTimeout function, config files sometimes are applied to each textarea and sometimes no. Sometimes teaser.js applies to two textareas, and sometimes content.js applies to two textares. It's easy to see the problem reloading consecutively. It not happens only in IE, I haver tried on Chrome, FF and same effect.
Re: Multiple instances with different config files in IE bro
I have exactly the same issue not only on IE, but on all explorers (IE,FF, Chrome, etc).
What I have: 2 editors, one with a custom JS config file basic.js, the other with default.js
Here is my code, the HTML part and the JS/JQuery part:
If I only instance one editor at a time, it loads the correct configuration. But if more than one, like in my example above, all editors take the config aplied to the last editor....
Any clues????
Re: Multiple instances with different config files in IE bro
The front end is this
Re: Multiple instances with different config files in IE bro
This problem is reported in this ticket: http://dev.ckeditor.com/ticket/6504
Re: Multiple instances with different config files in IE bro
var small_editor = {width:200,height:400};
Then you can define for the editor to use this instead of a completely different config file.
$(".editor").ckeditor(small_editor);
I've also been trying to
I've also been trying to figure out this custom toolbars with multiple instances of CKEditor on one page. silverbackis had a good clue on how to make them different sizes - his solution worked (thanks!).
I have a big problem trying to get the custom toolbars to work at all. For example, in config.js, I have:
config.toolbar_Basic = [
['Bold','Italic','Underline','-','NumberedList','BulletedList','-','Undo','Redo']
];
config.toolbar_BasicPlusPH = [
['CreatePlaceholder','-','Bold','Italic','Underline','-','NumberedList','BulletedList','-','Undo','Redo']
];
Then when I try to create an editor like this:
CKEDITOR.replace( 'textarea_id', {height: 140, width: 290},
{toolbar: 'Basic'}
); // does not work, gives me full toolbar instead
CKEDITOR.replace( 'textarea_id', size_editor,
{toolbar: ['CreatePlaceholder','-','Bold','Italic','Underline','-','NumberedList','BulletedList','-','Undo','Redo']}); // DOES NOT WORK EITHER, shows FULL toolbar instead
Instead I have to put a line like this: CKEDITOR.config.toolbar = 'Basic';
But then both CKEditor instances have the same toolbar. If I later put another line: CKEDITOR.config.toolbar = 'BasicPlusPH';
Then both editors get the BasicPlusPH toolbar. Either of the above lines gives me the correct toolbar I made, but whatever line is last is what both toolbars look like.
So first of all, why doesn't the syntax to specify the toolbar inside the CKEDITOR.replace call not work? I've looked at tons of examples, and they do not work.
Second of all, is it possible to get two different toolbars on two different instances of CKEditor? And please keep in mind, if you mention to use the "{toolbar: 'BasicPlusPH'} inside the replace call - that I cannot get this to work at all - even with once instance of CEditor on the page.
I appreciate any help!