How to remove buttons from CKeditor 4

后端 未结 10 1460
难免孤独
难免孤独 2020-12-24 12:36

The question is in the title : How to remove buttons from CKeditor 4 .

Documentation does not answer it clearly

10条回答
  •  时光说笑
    2020-12-24 13:34

    The first way to solve this problem

    1. Go to node modules -> @ckeditor -> ckeditor-build-classic -> build ->ckeditor.js

    Go or search for defaultConfig in ckeditor.js --- you will find out in the last few lines

    Here remove the unwanted fields like table, media, etc

    The second way to solve the problem

    Here are the complete list:

    defaultConfig={toolbar:{items:["heading","|","bold","italic","link","bulletedList","numberedList","|","indent","outdent","|","imageUpload","blockQuote","insertTable","mediaEmbed","undo","redo"]},image:{toolbar:["imageStyle:full","imageStyle:side","|","imageTextAlternative"]},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells"]},language:"en"}}]).default}
    

    Eg - remove the table from the Editor

    defaultConfig={toolbar:{items:["heading","|","bold","italic","link","bulletedList","numberedList","|","indent","outdent","|","imageUpload","blockQuote","mediaEmbed","undo","redo"]},image:{toolbar:["imageStyle:full","imageStyle:side","|","imageTextAlternative"]},language:"en"}}]).default}
    

    put in the constructor of the component.ts file

    ClassicEditor.defaultConfig={toolbar:{items:["heading","|","bold","italic","link","bulletedList","numberedList","|","indent","outdent","|","imageUpload","blockQuote","mediaEmbed","undo","redo"]},image:{toolbar:["imageStyle:full","imageStyle:side","|","imageTextAlternative"]},language:"en"}}]).default}
    

提交回复
热议问题