如何在TYPO3 CKEditor中启用colorbutton

时间:2018-08-22 20:09:08

标签: ckeditor typo3 typo3-8.x rte typo3-extensions

我正在尝试使colorbutton插件能够使用TYPO3 CKEditor中的TextColor功能,但是它将不起作用。

我已经尝试包括colorbutton插件所需的所有必需的外部插件。我已经直接从CKEditor网站(buttonpanelbuttonpanelfloatpanel)下载了4.7版的插件。但是每次当我包含panelbutton或colorbutton时,TYPO3后端中的Editor都不再起作用。

包含插件的代码: Code where the plugins gets included

在包含panelbutton或colorbutton插件后,Editor破裂: Editor broke after including panelbutton or colorbutton 我的目标是在工具栏中设置此按钮: goal

2 个答案:

答案 0 :(得分:2)

以下配置应该起作用:

editor:
    config:
        toolbarGroups:
            - { name: colors }

        extraPlugins:
            - colorbutton

        #configuration example:
        colorButton_colors: "F49800,B9B9B9,75A75A"

答案 1 :(得分:2)

对于仍在通过向TYPO3 CKEditor添加colorbutton插件而苦苦挣扎的人们,这是我的最终解决方案:

custom.yaml文件是使用此documentation创建的,请参见页面结尾的可下载的yaml file
所有CKEditor插件都可以直接从官方addons plugin page下载。不要忘记包括可能的依赖项。我已经下载了4.7版的插件,并且工作正常。确保将插件放置在Public目录而不是Private目录中,这是我的错误。

custom.yaml:

[...]
editor:
  externalPlugins:
    button: { resource: "EXT:yourSitePackage/Resources/Public/ckeditor/plugins/button/plugin.js" }
    panelbutton: { resource: "EXT:yourSitePackage/Resources/Public/ckeditor/plugins/panelbutton/plugin.js" }
    panel: { resource: "EXT:yourSitePackage/Resources/Public/ckeditor/plugins/panel/plugin.js" }
    floatpanel: { resource: "EXT:yourSitePackage/Resources/Public/ckeditor/plugins/floatpanel/plugin.js" }
    colorbutton: { resource: "EXT:yourSitePackage/Resources/Public/ckeditor/plugins/colorbutton/plugin.js" }

  config:
    extraPlugins:
      - button
      - panelbutton
      - panel
      - floatpanel
      - colorbutton

    toolbar:
      - { name: 'colors', items: [ 'TextColor', 'BGColor' ] }
    [...]

    colorButton_enableAutomatic: false
    colorButton_enableMore: false
    colorButton_colors: 000000,167951,93C0BD,F48E00
  [...]


最终结果: Result of TYPO3 CKEditor with colorbutton plugin

相关问题