2amigos / yii2-ckeditor-widget

CKEditor WYSIWYG widget for Yii2.
https://2amigos.us/open-source/ckeditor-widget
Other
172 stars 112 forks source link

toolbarGroups settings not work with version 2.0.0 #87

Closed yangtoude closed 7 years ago

yangtoude commented 8 years ago

Hi @tonydspaniard got a problem with toolbarGroups settings

    'widgetOptions' => [
        'class' => '\dosamigos\ckeditor\CKEditor',
        'preset' => 'custom',
        'clientOptions' => [
            'allowedContent' => true,
            'extraPlugins' => 'lineheight,uploadimage',
            'line_height' => '1;1.2;1.5;2;2.5;3',
            'imageUploadUrl' => '/accelerator/upload',
            'toolbarGroups' => [
                ['name' => 'forms'],
                ['name' => 'others'],
            ],
        ],
    ]

but only standard toolbar shows, the toolbarGroups settings just not work screen shot 2016-10-09 at 5 56 06 pm

CyanoFresh commented 8 years ago

+1

yangtoude commented 8 years ago

Hi, @tonydspaniard I found that I can add button by adding extra plugins according to How to add custom plugins , for example, colorbutton. Does mean that I have to add other buttons(except standard buttons) by adding extra plugins since version 2.0.0? I don't think it's a good way to do that. By the way, toolbarGroups still not work. Here is my widget options:

'widgetOptions' => [
    'class' => '\dosamigos\ckeditor\CKEditor',
    'preset' => 'full',
    'clientOptions' => [
        'allowedContent' => true,
        'extraPlugins' => 'lineheight,uploadimage,colorbutton',
        'line_height' => '1;1.2;1.5;2;2.5;3',
        'imageUploadUrl' => '/accelerator/upload',
    ],
]

And I also found that the Basic Styles plugin, which has been integrated into the editor and should have Bold Italic Underline Strikethrough Subscript Superscript format commands, actually has only Bold Italic Strikethrough commands, lacking other three commands. I tried to add this plugin according to How to add custom plugins, but it didn't work as well as colorbutton plugin. Is there any other way to config Basic Styles plugin in order to add the other threee commands?

CyanoFresh commented 8 years ago

Changing the config.js and presets/full.php doesn't work

tonydspaniard commented 7 years ago

Dear @yangtoude I'll have a look at it... Thank you for the description. I would like to ask you if you have added the path of your extra plugins?

$this->registerJs("CKEDITOR.plugins.addExternal('pbckcode', '/pbckcode/plugin.js', '');");
tonydspaniard commented 7 years ago

@yangtoude according to the information http://docs.ckeditor.com/#!/guide/dev_toolbarconcepts-section-toolbar-groups-configuration you don't seem to have it correctly. What you need to do is to define your toolbar setting and then use the ['name' => 'GROUPNAME', 'items' => ['your items']

jeesus commented 7 years ago

The problem lies in the composer.json of this project. According to CKEditor docs, the composer's require part should look like this in order to get the full package:

{
    "require": {
        "ckeditor/ckeditor": "dev-full/stable"
    }
}
tonydspaniard commented 7 years ago

@yangtoude @jeesus @CyanoFresh I have updated adding the dev-full, mind updating to 2.0.2 and tell me if it works for you guys? Thanks

CyanoFresh commented 7 years ago

will check as soon as I have some time

CyanoFresh commented 7 years ago

@tonydspaniard now works good. But composer chose 2.0.1 version, maybe stability issue. Thanks

tonydspaniard commented 7 years ago

@CyanoFresh great! Thank you for the feedback. Could be some requirements... I'll check that.