To modify the configuration file config.js to customize the Cheditor menu, you need the following steps:
1. Locate the Config.js file for the CKEditor installation directory
2. Make a note of the feature name you want to use, and the following "-" represents the delimiter, "/" for line break
[' Source ', '-', ' Save ', ' NewPage ', ' Preview ', '-', ' Templates '],
[' Cut ', ' Copy ', ' Paste ', ' pastetext ', ' Pastefromword ', '-', ' Print ', ' spellchecker ', ' Scayt '],
[' Undo ', ' Redo ', '-', ' Find ', ' Replace ', '-', ' selectall ', ' Removeformat '],
[' Form ', ' Checkbox ', ' Radio ', ' TextField ', ' Textarea ', ' Select ', ' Button ', ' ImageButton ', ' HiddenField '],
‘/‘,
[' Bold ', ' Italic ', ' underline ', ' Strike ', '-', ' subscript ', ' superscript '],
[' Numberedlist ', ' BulletedList ', '-', ' outdent ', ' Indent ', ' Blockquote '],
[' Justifyleft ', ' justifycenter ', ' justifyright ', ' Justifyblock '],
[' Link ', ' Unlink ', ' Anchor '],
[' Image ', ' Flash ', ' Table ', ' horizontalrule ', ' Smiley ', ' Specialchar ', ' pagebreak '],
‘/‘,
[' Styles ', ' Format ', ' Font ', ' FontSize '],
[' TextColor ', ' BGColor '],
[' Maximize ', ' showblocks ', '-', ' about ']
3, modify the Config.js file, assuming the following is the full content of Config.js
1Ckeditor.editorconfig =function(config)2 {3Config.toolbar = ' Mycustom ';//which configuration to choose here. The Mycustom configuration item is now selected, not the MYCUSTOM2 configuration item4Config.toolbar_mycustom =5 [6[' Bold ', ' Italic ', '-', ' Image ', ' Link ', ' Unlink ']//the menu here has bold, italic, picture management, hyperlinks, unlink, and no hyperlinks.7 ]8 9Config.toolbar_mycustom2 =Ten [ One[' Bold ', ' Italic ']//the menu here has bold, italic features A ] -};
If you want to add Flash, Cut, copy function in the Mycutom, it can be added inside, the code is as follows:
1Ckeditor.editorconfig =function(config)2 {3Config.toolbar = ' Mycustom ';4Config.toolbar_mycustom =5 [6[' Bold ', ' Italic ', '-', ' Image ', ' Link ', ' Unlink ', ' Flash ', ' Cut ', ' Copy ']//new features for Flash, Cut and copy are added here.7 ]8 9Config.toolbar_mycustom2 =Ten [ One[' Bold ', ' Italic '] A ] -};
Customizing the CKEditor Menu