首页 > 解决方案 > 从 TYPO3 中的 ckeditor 将“fontsize”添加到自定义 yaml 文件

问题描述

我有一个问题,我自己的自定义配置中没有显示“fontsize”字段。

我的 YAML 文件如下所示:

# Load default processing options
imports:
    - { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
    - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
    - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" }


# Add configuration for the editor
# For complete documentation see http://docs.ckeditor.com/#!/api/CKEDITOR.config
editor:
  config:
    contentsCss: ["EXT:rte_ckeditor/Resources/Public/Css/contents.css", "EXT:myext/Resources/Public/css/rte.css"]


    format_tags: "p;h1;h2;h3;h4;h5;pre;div"

    stylesSet:
      # block level styles
      - { name: "align-left", element: ['h1', 'h2', 'h3', 'h4','h5', 'h6', 'p', 'td', 'th'], attributes: { 'class': 'align-left' }}
      - { name: "align-center", element: ['h1', 'h2', 'h3', 'h4','h5', 'h6', 'p', 'td', 'th'], attributes: { 'class': 'align-center' }}
      - { name: "align-right", element: ['h1', 'h2', 'h3', 'h4','h5', 'h6', 'p', 'td', 'th'], attributes: { 'class': 'align-right' }}
      - { name: "align-justify", element: ['h1', 'h2', 'h3', 'h4','h5', 'h6', 'p', 'td', 'th'], attributes: { 'class': 'align-justify' }}
      - { name: "Interview", element: ['h5', 'p', 'span'], attributes: { 'class': 'ecx-interview' }}
      - { name: 'Underline whole element', element: 'p', attributes: { 'class': 'p-carreer' } }
      - { name: "Tiny Paragraph", element: "p", attributes: { 'class': 'p-tiny' }}
      # Inline styles
      - { name: 'Underline whole element', element: 'p', attributes: { 'class': 'p-carreer' } }
      - { name: "Important", element: "span", attributes: { 'class': 'c-important' }}
      - { name: "Tiny Word", element: "span", attributes: { 'class': 'c-tiny' }}
      # List styles
      - { name: 'Underline whole element', element: 'p', attributes: { 'class': 'p-carreer' } }
      - { name: 'UL Style 2', element: 'ol', attributes: { 'class': 'ul-style2' } }
      - { name: 'No UL Bullets', element: 'ul', attributes: { 'class': 'no-bullet' } }
      # Link styles
      - { name: "External Link", element: "a", attributes: { class: "external-link"} }
      - { name: "Arrow-link", element: "a", attributes: { class: "ecx-explore-arrow-link more d-flex align-items-center"} }
      # Form styles
      - { name: "Table Responsive", element: "table", attributes: { 'class': 'contenttable table-responsive' } }

    toolbar:
      - [ 'Link', 'Unlink', 'Anchor', 'Table', 'SpecialChar', 'CodeSnippet', 'Youtube' ]
      - [ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ]
      - [ 'NumberedList', 'BulletedList']
      - [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord' ]
      - [ 'Undo', 'Redo', 'RemoveFormat', 'ShowBlocks' ]
      - "/"
      - [ 'Format', 'Styles','Size' ]
      - [ 'Bold', 'Italic', 'Underline', 'Blockquote', 'Subscript', 'Superscript']
      - [ 'Source', 'Maximize', 'About']


    extraPlugins:
      - justify
      - specialchar
      - showblocks
      - codesnippet
      - font

    justifyClasses:
      - align-left
      - align-center
      - align-right
      - align-justify

    codeSnippet_theme: 'monokai_sublime'

    removePlugins:
      - image

processing:
  allowTags:
    - iframe

我尝试导入其他一些 .yaml (full, processing, ... ) 文件或包含来自 ckeditor 的官方字体插件,但没有任何效果。我正在使用 TYPO3 8.7.16。

后端的配置是这样的:TYPO3 Backend custom configuration ckeditor

谢谢!

标签: ckeditortypo3typo3-8.7.x

解决方案


使用您的配置:

    toolbar:
       - [ 'Format', 'Styles','FontSize' ]

代替

    toolbar:
       - [ 'Format', 'Styles','Size' ]

请参阅: CKEditor 4 - 如何将字体系列和字体大小控件添加到工具栏


推荐阅读