Support for changing toolbarGroups order

Created on 18 November 2013, over 10 years ago
Updated 8 October 2023, 9 months ago

Problem/Motivation

From the official CKEditor 4 Documentation:

Toolbar Groups Configuration

Note: This method requires manual crafting of the toolbar configuration code and is recommended to more advanced users.

CKEditor 4 introduced a new concept for toolbar organization which is based on "grouping" instead of the traditional "item by item positioning" way.

Grouping configuration is defined by the CKEDITOR.config.toolbarGroups setting. The following is the configuration used by the Standard distribution of CKEditor:

config.toolbarGroups = [
    { name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },
    { name: 'editing',     groups: [ 'find', 'selection', 'spellchecker' ] },
    { name: 'links' },
    { name: 'insert' },
    { name: 'forms' },
    { name: 'tools' },
    { name: 'document',    groups: [ 'mode', 'document', 'doctools' ] },
    { name: 'others' },
    '/',
    { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
    { name: 'paragraph',   groups: [ 'list', 'indent', 'blocks', 'align' ] },
    { name: 'styles' },
    { name: 'colors' },
    { name: 'about' }
];

It is a list (Array) of objects, each one with a name (e.g clipboard or links) and a optional "sub-groups" list.

Changing the Groups Order

You can easily customize the group ordering and position by simply changing the above configuration.

You can force row-breaks in the toolbar by adding '/' into the list, just like you could see above.

Note that there are unused groups in the above configuration. This is "by design" (see "The Benefits of Group Configuration").
...

Proposed resolution

Support this feature...

The Benefits of Group Configuration

The most important benefit of toolbar grouping configuration over the "item by item" configuration is: automation.

It is now possible for plugin developers to define into which toolbar group their plugins should add buttons. For example, the Image plugin, includes its button in the insert group, while the Undo and Redo buttons go into the undo sub-group.

While not mandatory, having all groups and sub-groups configured (including the ones that you do not use) is recommended because at any moment in the future, when a new plugin gets installed, its button will automatically appear in the toolbar without further configuration requirements.

Remaining tasks

TBD

User interface changes

TBD

API changes

???

Original report by @trainingcity β†’

Just installed the module and looks like a great little addition to the Drupal community. I am running a hacked CKEditor 4.3 implementation with the WYSIWYG module and I'd love to be able to manipulate the Group settings for the buttons from within your UI. Is this something you could consider adding?

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.69.0 2024