【发布时间】:2018-07-15 07:05:01
【问题描述】:
我想把oembed标签放到TYPO3的ckeditor RTE中。这样,我想将诸如 instagram、facebook 或 twitter 之类的社交帖子放入一些新闻文章中(在一些文本的中间)。
为此,我激活了ckeditor的嵌入插件,并将processing下的oembed标签放在allowedTags中。我还在styles.content.allowTags的常量中定义了oembed标签。
这是我的 yaml:
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:mysitepackage/Resources/Public/Css/rte.css"
stylesSet:
- { name: "Lead", element: "p", attributes: { 'class': 'lead' } }
toolbarGroups:
- { name: styles, groups: [ format, styles ] }
- { 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 ] }
format_tags: "p;h1;h2;h3;h4;h5;pre"
justifyClasses:
- text-left
- text-center
- text-right
- text-justify
extraPlugins:
- justify
- embedsemantic
- autoembed
removePlugins:
- image
removeButtons:
- Anchor
- Underline
- Strike
autoEmbedWidget: "embedsemantic"
embed_provider: "https://my.iframely.instance/oembed?url={url}&callback={callback}"
extraAllowedContent: '*(*)[data-*]; oembed'
processing:
allowTags:
- oembed
常量中的这一行:
styles.content.allowTags := addToList(oembed)
我现在可以将 oembed 放入 RTE 及其显示的社交帖子预告片中。保存内容后,oembed 标签被替换为p 标签
我错过了什么?
【问题讨论】:
-
能否提供一个ckeditor中的html源码修改前后的例子?
-
之前:
<oembed>[URL OF POST]</oembed>之后:<p>[URL OF POST]</p> -
如果它不吃 YML 中的处理设置,是否还吃掉 RTE 的常规 TSconfig?喜欢
RTE.default.proc.allowTags = oembed