egeloen / IvoryCKEditorBundle

Provides a CKEditor integration for your Symfony project.
MIT License
336 stars 114 forks source link

Plugins not loaded from correct folder #314

Closed damienleduc closed 6 years ago

damienleduc commented 7 years ago

Hello,

I'm trying to install a plugin (wordcount) like shown in the documentation but i got a trouble. When i put the plugin in config.yml, ckeditor try to load plugin.js from "/bundles/ivoryckeditor/plugins/wordcount/plugin.js" instead of "/ckeditor/wordcount/plugin.js"

ivory_ck_editor:
    default_config: my_config
    configs:
        my_config:
            extraPlugins: "wordcount"
            filebrowserBrowseRoute: elfinder
            filebrowserBrowseRouteParameters:
                instance: my_default
            height: 500
        plugins:
            wordcount:
                path:     "/ckeditor/wordcount/"
                filename: "plugin.js"

However, if I put the configuration directy in the Form class it works perfectly and load the plugin from "/ckeditor/wordcount/plugin.js"

$builder->add('content', CKEditorType::class, array(
    'plugins' => array(
        'wordcount' => array(
            'path'     => '/ckeditor/wordcount/',
            'filename' => 'plugin.js',
        ),
    ),
));

Thanks

Clanver commented 7 years ago

Can confirm, after adding the configuration in the Formbuilder instead of the config.yml it works.

karael commented 7 years ago

+1

egeloen commented 6 years ago

The issue is in your YAML indentation. The plugins node is a dedicated node and not an embed node of the config one. Basically, you register a plugin in CKEditor with the plugins node and with the extraPlugins node, you use it in a config.

The following config works fine:

ivory_ck_editor:
    default_config: my_config
    configs:
        my_config:
            extraPlugins: "wordcount"
            filebrowserBrowseRoute: elfinder
            filebrowserBrowseRouteParameters:
                instance: my_default
            height: 500
    plugins:
        wordcount:
            path:     "/ckeditor/wordcount/"
            filename: "plugin.js"
damienleduc commented 6 years ago

Oups my bad sorry tkank you for your help