Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to change editor toolbar (3.3.1 with patched CKEditor 4.3.2)
#1
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?
Reply
#2
(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.)
--
Nick.
Reply
#3
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';
};
Reply
#4
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.
Reply
#5
The comma and the spaces are an issue, not sure why yet.

define('GSEDITORTOOL', "[ 'JustifyLeft','JustifyCenter','JustifyRight' ]");
works fine
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#6
fixed, thanks for the bug report

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

https://github.com/GetSimpleCMS/GetSimpl...260c78962e
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#7
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
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#8
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
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#9
Thanks a lot for the help! I removed the whitespace for now and that's working.
Reply




Users browsing this thread: 2 Guest(s)