CKeditor自定义插件顺序

CKeditor custom plugins order

本文关键字:顺序 插件 自定义 CKeditor      更新时间:2023-09-26

嗨,我使用的是带有4个自定义插件的ckeditor 4.3.2版本,它们出现在插入工具栏中,我以这种方式调用插件:

extraPlugins: 'aexpagebreak,aexextraline,aexsinglecolumn,aextwocolumn',

它们加载得很好,但每次页面重新加载时,栏中插件的顺序都会随机变化,我如何在工具栏中定义插件图标的固定顺序?

您可以自己配置工具栏,定义一个对象,告诉ckeditor如何显示和分组项目。

http://docs.ckeditor.com/#/guide/dev_toolbar

来自ckeditor文档:

config.toolbarGroups = [
    { name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },
    { name: 'editing',     groups: [ 'find', 'selection', 'spellchecker' ] },
    { name: 'links' },
    { name: 'insert' },
    { name: 'forms' },
    { name: 'tools' },
    { name: 'document',    groups: [ 'mode', 'document', 'doctools' ] },
    { name: 'others' },
    '/',
    { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
    { name: 'paragraph',   groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
    { name: 'styles' },
    { name: 'colors' },
    { name: 'about' }
];

更多信息:

http://docs.ckeditor.com/#/guide/dev_toolbarconcepts-section-toolbar-groups-configuration

看起来他们的网站上有一个工具栏配置工具,但它可能只适用于4.5及更高版本。不完全确定:

http://ckeditor.com/tmp/4.5.0-beta/ckeditor/samples/toolbarconfigurator/index.html#basic