Typo3:8.7.9 CKeditor在保存后删除块样式

时间:2017-12-14 14:23:44

标签: css ckeditor typo3 yaml

我在Typo3中有以下YAML-config的CKEditor:

class User < ApplicationRecord
   has_many :blogs

   delegate :all_have_title?, to: :blogs, prefix: false, allow_nil: false
end

class Blog < ApplicationRecord
  belongs_to :user

  def self.all_have_title?
    where.not(title: nil)
  end
end

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

在保存CKEditor之前显示正确的

# 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 class="intro">Text</p>

其他定义(按钮(默认),PDF-Download)按预期工作。只有p-Tag上的两种样式不起作用。

有人知道为什么,可以给我一个提示吗?

1 个答案:

答案 0 :(得分:1)

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