您还需要将插件添加到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