Typo3:8.7.9 CKeditor保存后删除块样式 [英] Typo3: 8.7.9 CKeditor removes block-styles after save

查看:59
本文介绍了Typo3:8.7.9 CKeditor保存后删除块样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Typo3中具有以下CKEditor的YAML配置:

I have the following YAML-config of the CKEditor in Typo3:

# 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:
    # can be "default", but a custom stylesSet can be defined here, which fits TYPO3 best.
    contentsCss: "/templates/path/css/_collection/rte.css"
    format_tags: "p;h1;h2;h3;h4;h5;pre"
    # Samples for configuration
    stylesSet:
      # block level styles
      #- { name: "Beispiel H2", element: "h2", styles: { color: "orange", background: "blue" } }
      - { name: "Button (default)", element: "a", attributes: { class: "btn btn-default" } }
      - { name: "Button (primary)", element: "a", attributes: { class: "btn btn-primary" } }
      - { name: "h2", element: "p", attributes: { class: "h2" } }
      - { name: "Intro", element: "p", attributes: { class: "intro" } }

      # Inline styles
      #- { name: "Beispiel-Link auf a", element: "a", styles: { color: "red" } }
      - { name: "Link mit Pfeil", element: "a", attributes: { class: "linkpfeil" } }
      - { name: "PDF-Download", element: "a", attributes: { class: "download-pdf" } }


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

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

    extraPlugins:
      - justify

    removePlugins:
      - image

    removeButtons:
      - Anchor
      - Underline
      - JustifyBlock
      - Table

# Allow s and u tag
processing:
  allowTags:
    - s

当我编辑文本时,一切正常。我可以选择两个 p -blockstyles h2和 intro,但是保存后样式消失了。

When I edit the the text everything works fine. I can choose the two "p"-blockstyles "h2" and "intro", but after saving, the style is gone.

在保存CKEditor之前,显示正确 p>

Before saving the CKEditor shows correct

<p class="intro">Text</p>

保存后就是

<p>Text</p>

其他定义(按钮(默认),PDF下载)按预期工作。 p-Tag上只有两种样式无效。

The other definitions (Button (default), PDF-Download) work as intended. Only the two styles on the p-Tag don't work.

有人知道为什么并且可以给我提示吗?

Does someone know why and can give me a hint?

推荐答案

我从Typo3 7更新了该项目。旧的htmlArea编辑器仍然存在并已安装。我卸载了这个过时的扩展程序。现在一切正常。

I updated this project from Typo3 7. The old editor htmlArea was still present and installed. I deinstalled this obsolete extension. Now everything works fine.

这篇关于Typo3:8.7.9 CKeditor保存后删除块样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆