如何在 TYPO3 CKEditor 中启用颜色按钮

How to enable the colorbutton in the TYPO3 CKEditor

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

我已经尝试包含 colorbutton 插件所需的所有外部插件。我直接从 CKEditor 网站 (button, panelbutton, panel, floatpanel) 下载了 4.7 版的插件。但是每次当我包含 panelbutton 或 colorbutton 时,TYPO3 后端中的编辑器就不再工作了。

包含插件的代码:

编辑器在包含 panelbutton 或 colorbutton 插件后出现问题: 我的目标是在工具栏中有这个按钮:

以下配置应该有效:

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

        extraPlugins:
            - colorbutton

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

对于那些还在为 TYPO3 CKEditor 添加 colorbutton 插件而苦苦挣扎的人,这里是我的最终解决方案:

custom.yaml 文件是用页面末尾的 documentation, see the downloadable 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
  [...]


最终结果: