Can I use CKEditor without a toolbar?

后端 未结 8 1510
迷失自我
迷失自我 2020-12-14 07:35

(Possible duplicate: CKEditor - No toolbars)

I\'d like to create a CKEditor instance without a toolbar. I tried defining an empty toolbar to use in the instance\'s c

8条回答
  •  粉色の甜心
    2020-12-14 07:54

    Wow :) This is something that we haven't thought of while implementing toolbar. But I've just checked that you can remove toolbar plugin, because it isn't required by any other plugin.

    So build your own CKEditor package without toolbar or use removePlugins configuration - e.g.:

    var editor = CKEDITOR.inline( 'editable', {
        removePlugins: 'toolbar'
    } );
    

    Update: In CKEditor 4.1 the Advanced Content Filter was introduced. In its automatic mode it is configured by buttons which are loaded to toolbar. Without toolbar plugin ACF is not configured, so one need to do this on his own:

    var editor = CKEDITOR.inline( 'editable', {
        removePlugins: 'toolbar',
        allowedContent: 'p h1 h2 strong em; a[!href]; img[!src,width,height];'
    } );
    

提交回复
热议问题