-1

In CKEDITOR's documentation there are suggestions to use the following in the config.js file:

CKEDITOR.editorConfig = function( config ) {
    config.toolbar_Full = [
         { name: 'document', items : [ 'Source','-',
           'Save','NewPage','DocProps','Preview',
           'Print','-','Templates' ] }
    ];
    config.toolbar = 'Full';
 };

Though that actually does not work. It only works without the parens:

 CKEDITOR.editorConfig = function( config ) {
    config.toolbar_Full = [
         [ 'Source','-','Save','NewPage','DocProps',
           'Preview','Print','-','Templates' ]
    ];
    config.toolbar = 'Full';
 };

Now, Perch also has this little rig: CKEDITOR.replace that is meant to be used inline, but I would like to use it in the config.js file. How do I rewrite the call to CKEDITOR.replace so that it works inside config.js?

CKEDITOR.replace( 'editor1', {
    toolbar : 'Full'
});

CKEDITOR.replace( 'editor2', {
    toolbar : 'Basic'
});
Urs
  • 4,984
  • 7
  • 54
  • 116
sandraqu
  • 1,428
  • 1
  • 14
  • 31
  • Actually, the code in your first example does work. You should probably try to get a basic set up working before you try to change things. Have you checked if the files located in the ckeditor/_samples folder load correctly? The ckeditor/INSTALL.html file recommends that you verify your installation is working correctly by looking at the sample files. The samples files have examples of how to modify the toolbar settings. – codewaggle Sep 16 '11 at 06:57

2 Answers2

1

As I replied in CKEditor forums, you must be using an old version of CKEditor, that toolbar syntax was introduced in CKEditor 3.6

AlfonsoML
  • 12,634
  • 2
  • 46
  • 53
0

Just load the CKEditor with your custom config:

CKEDITOR.replace( 'editor1', {
  toolbar: [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ]
});

Or define your custom toolbar and load it:

CKEDITOR.replace( 'editor2', {
  toolbar_Custom: [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ],
  toolbar: 'Custom'
});
atma
  • 875
  • 7
  • 10