3

Is there a way for multiple versions of ckeditor library to exist on the same page without conflicting with the other version? The way jquery as jquery.noConflict mode?

The use case is that there are different teams in our organization building different widgets and 2 of them are using some forked and customized ckeditors and both are of different release versions. Currently, things are broken when they conflict on the same page.

Anyone faced similar issue and tried to solve this before?

  • I tried. Not possible because of global variables. I suggest you to build a common ckeditor which will work for everybody. https://ckeditor.com/cke4/builder – aagjalpankaj Dec 27 '17 at 05:55

2 Answers2

3

There is no such feature in CKEditor. CKEditor register global variable CKEDITOR, that's why loading another version will not work. Hiding global variable under some kind of closure might be tricky and for sure will require a lot of work with it. There is bunch of different things which are loaded with CKEditor (like some custom styles, or not minified libs). So you should somehow take care about it too.

You should be able to load different versions in separate iframes, this will provide you separate environment, where different versions will work separately.

Another more convenient option would be to prepare only one version which will work for everybody, and just provide different configs for every instance which should differ. This will load library only once on your page. For example you might remove some plugins by using config.removePlugins. There is also plenty of other things you can customise for every single editor instance.

Mateusz
  • 683
  • 4
  • 17
  • We too have come to the same conclusion. Sharing the same editor with different configs is not a straight forward option for us since we cannot mandate the version of the other team and we don't want to switch to a different version either since every time some other team upgrades their version, we will have to do the same. Iframes although not the cleanest way of doings seem to be a valid work around currently – Sudheer Kumar Oct 13 '17 at 10:43
0

You could try running each version inside of its own iframe

Charlie Araya
  • 430
  • 4
  • 9