indvd00m@0: indvd00m@0: indvd00m@0: indvd00m@0:
indvd00m@0: indvd00m@0:indvd00m@0: This sample page demonstrates editor with loaded full toolbar (all registered buttons) and, if indvd00m@0: current editor's configuration modifies default settings, also editor with modified toolbar. indvd00m@0:
indvd00m@0: indvd00m@0:Since CKEditor 4 there are two ways to configure toolbar buttons.
indvd00m@0: indvd00m@0:
indvd00m@0: You can explicitly define which buttons are displayed in which groups and in which order.
indvd00m@0: This is the more precise setting, but less flexible. If newly added plugin adds its
indvd00m@0: own button you'll have to add it manually to your config.toolbar setting as well.
indvd00m@0:
To add a CKEditor instance with custom toolbar setting, insert the following JavaScript call to your code:
indvd00m@0: indvd00m@0:
indvd00m@0: CKEDITOR.replace( 'textarea_id', {
indvd00m@0: toolbar: [
indvd00m@0: { name: 'document', items: [ 'Source', '-', 'NewPage', 'Preview', '-', 'Templates' ] }, // Defines toolbar group with name (used to create voice label) and items in 3 subgroups.
indvd00m@0: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ], // Defines toolbar group without name.
indvd00m@0: '/', // Line break - next group will be placed in new line.
indvd00m@0: { name: 'basicstyles', items: [ 'Bold', 'Italic' ] }
indvd00m@0: ]
indvd00m@0: });
indvd00m@0:
indvd00m@0:
indvd00m@0: You can define which groups of buttons (like e.g. basicstyles, clipboard
indvd00m@0: and forms) are displayed and in which order. Registered buttons are associated
indvd00m@0: with toolbar groups by toolbar property in their definition.
indvd00m@0: This setting's advantage is that you don't have to modify toolbar configuration
indvd00m@0: when adding/removing plugins which register their own buttons.
indvd00m@0:
To add a CKEditor instance with custom toolbar groups setting, insert the following JavaScript call to your code:
indvd00m@0: indvd00m@0:
indvd00m@0: CKEDITOR.replace( 'textarea_id', {
indvd00m@0: toolbarGroups: [
indvd00m@0: { name: 'document', groups: [ 'mode', 'document' ] }, // Displays document group with its two subgroups.
indvd00m@0: { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, // Group's name will be used to create voice label.
indvd00m@0: '/', // Line break - next group will be placed in new line.
indvd00m@0: { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
indvd00m@0: { name: 'links' }
indvd00m@0: ]
indvd00m@0:
indvd00m@0: // NOTE: Remember to leave 'toolbar' property with the default value (null).
indvd00m@0: });
indvd00m@0: Below you can see editor with full toolbar, generated automatically by the editor.
indvd00m@0:
indvd00m@0: Note: To create editor instance with full toolbar you don't have to set anything.
indvd00m@0: Just leave toolbar and toolbarGroups with the default, null values.
indvd00m@0: