Search code examples
ckeditorzikula

How can I manage to have two different toolbars in CKEditor for two different groups?


I am using Zikula 1.4.6 with several modulstudio generated modules. These modules do have scribite plugin activated. If I use the "full" toolbar I do see all my modules in this toolbar. But I have to create a stripped down toolbar for my normal users. There they should not have acces to all modul plugins. So I generated the "special1" toolbar accordingly. The "special2" toolbar is prepared for my advanced users named "redakteure".

Zikula offers stil the possibility to use the overwrite.yml (Scribite is an older style module where the symphony override is not working). But I do not see which file I do have to change to use the special1 or special2 depending on the permission or group situation.

Or is there a better way to do something to make some plugins only visible for some groups?

How can I manage to have two different toolbars in CKEditor for two different groups?


Solution

  • You need to incorporate a permission check here: https://github.com/zikula-modules/Scribite/blob/master/plugins/CKEditor/templates/editorheader.tpl#L31

    For example:

    {{checkpermission component='::' instance='.*' level='ACCESS_ADMIN' assign='isAdmin'}
    {{if $isAdmin}}
        toolbar: 'mySpecialToolbar',
    {{else}}
        toolbar: '{{$Scribite.editorVars.barmode}}',
    {{/if}}