【发布时间】:2020-04-03 17:17:11
【问题描述】:
我使用嵌入插件向我的 CKEditor 添加了 iframe。
当我尝试在 iframe 中添加它时它可以工作,什么时候保存它,它会在前端工作并像这样将它保存在数据库中:
<div data-oembed-url="https://www.youtube.com/watch?v=C0DPdy98e4c">
<div style="left: 0; width: 100%; height: 0; position: relative; padding-bottom: 75%;">
<iframe allow="encrypted-media; accelerometer; gyroscope; picture-in-picture" allowfullscreen="" scrolling="no" src="https://www.youtube.com/embed/C0DPdy98e4c?rel=0" style="border: 0; top: 0; left: 0; width: 100%; height: 100%; position: absolute;" tabindex="-1">
</iframe>
</div>
</div>
但是当我现在在后端再次打开编辑器时,iframe 坏了,当我点击源代码时,它看起来像这样:
<div data-oembed-url="https://www.youtube.com/watch?v=C0DPdy98e4c">
<div style="left: 0; width: 100%; height: 0; position: relative; padding-bottom: 75%;">
<p>
<iframe allow="encrypted-media; accelerometer; gyroscope; picture-in-picture" allowfullscreen="" scrolling="no" src="https://www.youtube.com/embed/C0DPdy98e4c?rel=0" style="border: 0; top: 0; left: 0; width: 100%; height: 100%; position: absolute;" tabindex="-1"
></iframe>
</p>
</div>
</div>
我的编辑器的配置如下所示:
editor:
config:
removePlugins:
- null
removeButtons:
- Strike
AllowedContent:
- true
allowTagsOutside:
- iframe
allowTags:
- iframe
在我的 Page.ts 中我添加了这个:
RTE {
default {
proc.allowTags := addToList(object,param,embed,iframe)
proc.allowTagsOutside := addToList(object,embed,iframe)
proc.entryHTMLparser_db.allowTags < .allowTags
proc.entryHTMLparser_db.allowTags := addToList(iframe)
}
}
【问题讨论】:
标签: iframe ckeditor typo3 typo3-8.x typo3-9.x