Can I use CKEditor without a toolbar?

后端 未结 8 1522
迷失自我
迷失自我 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 08:01

    There are two ways I have seen:

    1) Using the removePlugins option and just remove the toolbar:

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

    2) Using CSS - Not the standard approach: (little tricky)

    Just make css to display:none the toolbar, like

    .cke_inner {
        display: none;
    }
    

    In version 4.13, you can hide the entire top bar containing the toolbar:

    .cke_inner .cke_top {
        display: none;
    }
    

    or hide only the toolbar but keep a strip of color at the top:

    .cke_inner .cke_top .cke_toolbox {
        display: none;
    }
    

    Hope it will help someone.

提交回复
热议问题