Problems specifying contentCss outside CKEditor.basepath

1.6k views Asked by At

We are trying to use CKEditor as a Widget for Vignette, when we try to specify a content css outside the environment of CKEditor such as:

"CKEDITOR.config.contentsCss = 'http://lvhost:27110/CKEditorbk/my.css';" 

doesn't work, but when we specify a content css included in the war where we have our deployment of ckeditor such as:

CKEDITOR.config.contentsCss = 'http://lvhost:27110/CKEditor/ckeditor/my.css'; 

It's working as we expected. Isn't possible to specify a css outside "CKEditor.basepath"?

1

There are 1 answers

0
Trung Lê On

In fact you can't because CKEditor path scope is anything within a folder named ckeditor.

However you could have your custom css outside the CKeditor's ckeditor by replicating the same folder structure, that is /js/CUSTOM_CKEDITOR/ckeditor. I've done so when I wrote a plugin for CKeditor.

I have a custom css at /js/CUSTOM_CKEDITOR/ckeditor/plugins/my_plugin/css/custom.css. And in my /js/CUSTOM_CKEDITOR/ckeditor/config.js I used:

CKEDITOR.config.contentsCss = CKEDITOR.plugins.getPath( 'my_plugin' ) + 'css/custom.css';

Works sweet :)