GetSimple Support Forum
Unable to change editor toolbar (3.3.1 with patched CKEditor 4.3.2) - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Unable to change editor toolbar (3.3.1 with patched CKEditor 4.3.2) (/showthread.php?tid=5751)



Unable to change editor toolbar (3.3.1 with patched CKEditor 4.3.2) - Markus00000 - 2014-03-07

When I change the editor toolbar in gsconfig.php as in the past, no toolbar will be shown and the WYSIWYG window will be plain text without any styles and everything is wrapped in <p></p>. For example:

Code:
define('GSEDITORTOOL', "
    [ 'JustifyLeft','JustifyCenter','JustifyRight' ],
    ");

Not changing the toolbar or setting the toolbar to 'basic' or 'advanced' will show the advanced 5-row toolbar:

Code:
define('GSEDITORTOOL', 'basic');
Code:
define('GSEDITORTOOL', 'advanced');
Code:
#define('GSEDITORTOOL', 'advanced');

I also tried to modify /admin/template/js/ckeditor/config.js without effect:

Code:
CKEDITOR.editorConfig = function( config ) {
    config.toolbar =  [
        [ 'JustifyLeft','JustifyCenter','JustifyRight' ],
    ];
};

So, my question is: How does changing the toolbar work now or what am I suddenly doing wrong?


RE: Unable to change editor toolbar (3.3.1 with patched CKEditor 4.3.2) - hameau - 2014-03-07

(2014-03-07, 19:05:44)Markus00000 Wrote: When I change the editor toolbar in gsconfig.php as in the past, no toolbar will be shown ...

So, my question is: How does changing the toolbar work now or what am I suddenly doing wrong?

You may find inspiration in the CKEditor docs. The toolbar definition scheme has changed for v4.

Here's a good starting place: CKEditor forum thread. If you find a solution, you could put it in the wiki ... ;-)

(This isn't just a RTFM reply – I don't know the answer.)


RE: Unable to change editor toolbar (3.3.1 with patched CKEditor 4.3.2) - Markus00000 - 2014-03-07

Thanks, I've already been on that page. The last example I gave is similar to this one from the official docs:

Code:
config.toolbar = [
    [ 'Source', '-', 'NewPage', 'Preview', '-', 'Templates' ],
    [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ],
    '/',
    [ 'Bold', 'Italic' ]
];

I've put this in config.js. Interestingly, changing the example values in that file had no effect either:

Code:
CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here. For example:
    // config.language = 'fr';
     config.uiColor = '#ff0000';
};



RE: Unable to change editor toolbar (3.3.1 with patched CKEditor 4.3.2) - Timbow - 2014-03-07

There was a problem with certain plugins in 3.3.0 but Shawn fixed it for 3.3.1, (FIX #753 support plugins that modify cke globals). In my case it was the Multi-User Plugin that knocked out the editor when a custom toolbar was specified.

You are using 3.3.1 with patched.... I see. I expect Shawn will be along.


RE: Unable to change editor toolbar (3.3.1 with patched CKEditor 4.3.2) - shawn_a - 2014-03-08

The comma and the spaces are an issue, not sure why yet.

define('GSEDITORTOOL', "[ 'JustifyLeft','JustifyCenter','JustifyRight' ]");
works fine


RE: Unable to change editor toolbar (3.3.1 with patched CKEditor 4.3.2) - shawn_a - 2014-03-08

fixed, thanks for the bug report

https://github.com/GetSimpleCMS/GetSimpleCMS/issues/775

https://github.com/GetSimpleCMS/GetSimpleCMS/commit/8e7c6234c4f48663ac66c93b0aeace260c78962e


RE: Unable to change editor toolbar (3.3.1 with patched CKEditor 4.3.2) - shawn_a - 2014-03-08

fyi as of 3.2 toolbars can be configured as php arrays, json arrays or old format.
Although you cannot define an array in gsconfig, but json should work and be cleaner.

You can also define toolbar ids, and stick your toolbars in your custom config.js

https://github.com/GetSimpleCMS/GetSimpleCMS/issues/561


RE: Unable to change editor toolbar (3.3.1 with patched CKEditor 4.3.2) - shawn_a - 2014-03-08

Sorry i ran into a bunch of stuff testing out this.

So to sum up, there are alot of new options for setting toolbars, which are all broken at this time.
Broken in the sense that they are whitespace sensitive. Most importantly the first [ or [[ need to have no whitespace in front of them.

some of this is fixed in 3.3.2


RE: Unable to change editor toolbar (3.3.1 with patched CKEditor 4.3.2) - Markus00000 - 2014-03-10

Thanks a lot for the help! I removed the whitespace for now and that's working.