您還需要將插件添加到ckeditor.replace中。這是一個簡單的例子。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>A Simple Page with CKEditor</title>
<!-- Make sure the path to CKEditor is correct. -->
<script src="ckeditor.js"></script>
</head>
<body>
<form>
<textarea name="editor1" id="editor1" rows="10" cols="80">
This is my textarea to be replaced with CKEditor.
</textarea>
<script>
// Replace the <textarea id="editor1"> with a CKEditor
// instance, using default configuration.
CKEDITOR.replace('editor1', {
extraPlugins: 'timestamp'
} );
</script>
</form>
</body>
</html>
config.js文件。
CKEDITOR.editorConfig = function(config) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.toolbarGroups = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing'] },
{ name: 'forms', groups: [ 'forms' ] },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph', 'timestamp'] },
{ name: 'links', groups: [ 'links' ] },
{ name: 'insert', groups: [ 'insert' ] },
'/',
{ name: 'styles', groups: [ 'styles' ] },
{ name: 'colors', groups: [ 'colors' ] },
{ name: 'tools', groups: [ 'tools' ] },
{ name: 'others', groups: [ 'others' ] },
{ name: 'about', groups: [ 'about' ] }
];
config.extraPlugins = 'timestamp';
config.allowedContent = true;
};
謝謝...但可悲的是,你提出的改變也沒有效果。工具欄根本沒有改變你發佈的配置,所以我真的想知道config.js文件是否被讀取。我已打開Chrome開發工具並且控制檯中沒有出現錯誤。 – RobG
也許嘗試再次下載ckeditor。我的配置工作正常http://i.imgur.com/RF0bcfG.png。你肯定在服務器上運行它? – David
下載它新鮮,移動的變化...相同的結果。 config.js肯定被忽略。我知道是因爲我在CKEDITOR.replace代碼中指定了寬度/高度,當我將它移動到配置文件時,它沒有任何作用,並且大小恢復爲「stock」。我感謝您的幫助;看起來像我有更大的問題。 – RobG