簡體   English   中英

如何在TYPO3 CKEditor中啟用colorbutton

[英]How to enable the colorbutton in the TYPO3 CKEditor

我試圖使colorbutton插件在TYPO3 CKEditor中使用TextColor功能,但是它將無法工作。

我已經嘗試包括colorbutton插件所需的所有必需的外部插件。 我已經直接從CKEditor網站( buttonpanelbuttonpanelfloatpanel )下載了4.7版的插件。 但是每次當我包含panelbutton或colorbutton時,TYPO3后端中的Editor都不再起作用。

包含插件的代碼: 包含插件的代碼

編輯器在包含panelbutton或colorbutton插件后崩潰了: 編輯器在包含panelbutton或colorbutton后破裂 我的目標是在工具欄中設置此按鈕: 目標

以下配置應該起作用:

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

        extraPlugins:
            - colorbutton

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

對於仍在通過向TYPO3 CKEditor中添加colorbutton插件而苦苦掙扎的人們,這是我的最終解決方案:

custom.yaml文件是使用此文檔創建的,請參閱頁面結尾的可下載yaml文件
所有CKEditor插件都可以從官方插件插件頁面直接下載。 不要忘記包括可能的依賴項。 我已經下載了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
  [...]


最后結果: 帶有colorbutton插件的TYPO3 CKEditor的結果

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM