duannaxin9975 2016-06-08 11:19
浏览 70
已采纳

IvoryCKEditorBundle:如何自定义工具栏项?

I need to customize the items of the toolbar of the Symfony bundle IvoryCKEditorBundle.

I know that the toolbar can be customized by adding items to it in this way, but how can I edit an item itself or create a custom item?

The CKEditor documentation explains it here, but I'm not sure how to do the same using the Symfony IvoryCKEditor bundle.

  • 写回答

1条回答 默认 最新

  • drygauost253590142 2016-06-08 15:05
    关注

    One elegant way could be by first creating a CKEditor plugin, and then loading the plugin into the IvoryCKEditorBundle:

    # app/config/config.yml
    ivory_ck_editor:
        default_config: my_config
        configs:
            my_config:
                extraPlugins: "mycustomplugin"
        plugins:
            mycustomplugin:
                path:     "/bundles/mybundle/mycustomplugin/"
                filename: "plugin.js"
    

    the plugin folder (in my example mycustomplugin) should be placed under the Resources/public folder of the bundle source (e.g. src/MyBundleName/Resources/pubic).

    Edit: also, be aware that if you need to install more than one plugin, the extraPlugins list should be separated by comma without space, like:

    extraPlugins: "mycustomplugin1,mycustomplugin2,mycustomplugin3"
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?