在CKEditor.basepath之外指定contentCss的问题

时间:2012-01-25 15:24:00

标签: ckeditor vignette

当我们尝试指定CKEditor时,我们尝试将Widget用作Vignette content css outside the environment of CKEditor,如:

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

不起作用,但是当我们指定战争中包含的内容css时,我们将部署ckeditor,例如:

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

它正如我们预期的那样工作。 Isn't possible to specify a css outside "CKEditor.basepath"?

1 个答案:

答案 0 :(得分:1)

实际上你不能,因为CKEditor路径范围是名为ckeditor的文件夹中的任何内容。

但是,您可以通过复制相同的文件夹结构/js/CUSTOM_CKEDITOR/ckeditor将您的自定义CSS放在CKeditor的ckeditor之外。当我为CKeditor编写插件时,我已经这样做了。

我在/js/CUSTOM_CKEDITOR/ckeditor/plugins/my_plugin/css/custom.css有一个自定义css。在我使用的/js/CUSTOM_CKEDITOR/ckeditor/config.js中:

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

作品甜蜜:)