【问题标题】:TYPO3 CKEditor – configuration not workingTYPO3 CKEditor – 配置不工作
【发布时间】:2017-10-02 11:59:22
【问题描述】:

我安装了 TYPO3 8.7.7,并且正在使用 rte_ckeditor。我正在尝试配置编辑器——但它似乎不起作用。 当我设置RTE.default.preset = full 或其他任何东西时,我的后端表单没有任何变化。

但我需要配置一些单独的选项。因此,我将默认预设设置为我自己的 YAML 文件 (RTE.default.preset = mytemplate),该文件也在我的扩展 ext_localconf.php 中注册,并带有

$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['mytemplate'] = 'EXT:mytemplate/Configuration/RTE/rte.yaml';

我已经清除了typo3temp文件夹,通过后端的系统缓存,通过安装工具的所有缓存,停用并重新激活了我的模板扩展。

我也没有在 RTE 更改我的后端表单中的任何内容。

它有时会做的唯一一件事是,当我清除后端的系统缓存并保存后端表单时,TYPO3 在我的 YAML 文件中显示语法错误 - 现在都已解决,但它也不再显示任何内容。只是默认的 RTE...

我的 YAML 文件没有什么特别之处……只是来了类和格式标签“pre”替换为“h6”

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" }

editor:
  config:

    contentsCss: ["EXT:mytemplate/Resources/Public/css/rte/rte.css"]

    format_tags: "p;h1;h2;h3;h4;h5;h6"

    stylesSet:
      - { 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: "Headline Stil 1", element: ['h1', 'h2', 'h3', 'h4','h5', 'h6'], attributes: { 'class': 'headline-style-1' }}
      - { name: "Headline Stil 2", element: ['h1', 'h2', 'h3', 'h4','h5', 'h6'], attributes: { 'class': 'headline-style-2' }}
      - { name: "Headline Stil 3", element: ['h1', 'h2', 'h3', 'h4','h5', 'h6'], attributes: { 'class': 'headline-style-3' }}
      - { name: "Headline Stil 4", element: ['h1', 'h2', 'h3', 'h4','h5', 'h6'], attributes: { 'class': 'headline-style-4' }}
      - { name: "Button-Link Primär", element: ['a'], attributes: { 'class': 'rte-btn-primary' }}
      - { name: "Button-Link Sekundär", element: ['a'], attributes: { 'class': 'rte-btn-secondary' }}
      - { name: "Button-Link Tertiär", element: ['a'], attributes: { 'class': 'rte-btn-tertiary' }}

    toolbarGroups:
      - { name: styles, groups: [ styles, format ] }
      - { name: basicstyles, groups: [ basicstyles ] }
      - { name: paragraph, groups: [ list, indent, blocks, align ] }
      - { name: links, groups: [ links ] }
      - { name: clipboard, groups: [ clipboard, cleanup, undo ] }
      - { name: editing, groups: [ spellchecker ] }
      - { name: insert, groups: [ insert ] }
      - { name: tools, groups: [ table, specialchar ] }
      - { name: document, groups: [ mode ] }

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

    extraPlugins:
      - justify

    removePlugins:
      - image

    removeButtons:
      - Anchor
      - Underline
      - Strike
      - Styles

让我的配置工作的诀窍是什么?!

【问题讨论】:

  • 我也在为同样的问题而苦苦挣扎...你有没有找到解决方案?
  • 您是否在 DCE 扩展中使用 RTE 字段?
  • 我正在使用fluid_content、fluidpages和flux
  • 好吧,也许是同样的问题。在下面查看我的答案。
  • 谢谢 - 似乎这是一个不断变化的错误/缺失功能。当我使用richtextConfiguration 时,它会抛出一个错误...

标签: ckeditor typo3 yaml typoscript typo3-8.7.x


【解决方案1】:

在我的例子中,我使用的是 DCE 扩展 - 预设被忽略了。要使用任何预设,请使用此 DCE 字段配置:

<config>
    <type>text</type>
    <rows>5</rows>
    <cols>30</cols>
    <eval>trim,required</eval>
    <enableRichtext>1</enableRichtext>
    <richtextConfiguration>mypreset</richtextConfiguration>
</config>

我通知了 DCE Ext 的 Ext 开发人员,他已经更新了 RTE 配置“预设”。

【讨论】:

  • 要了解您的 TYPO3 安装程序中配置了哪些预设,请查看 TYPO3 BE / 配置中的 $GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']。在 ['RTE']['Presets']['mypreset'] 中的 LocalCongifuration.php 中广告新预设
猜你喜欢
  • 1970-01-01
  • 2018-09-29
  • 1970-01-01
  • 1970-01-01
  • 2014-02-15
  • 1970-01-01
  • 1970-01-01
  • 2012-11-15
  • 2021-08-27
相关资源
最近更新 更多