我在 drupal 7 站点中使用 ckeditor。我想将 iframe 标签放入编辑器中。
目前,当我们将 iframe 放入 ckeditor 中时会发生什么。
<iframe src="http://www.lipsum.com/"></iframe>
它将 iframe 标签转换为带有一些特殊属性和 URL 的 img 标签。
<img class="cke_iframe" data-cke-realelement="%3Ciframe%20src%3D%22http%3A%2F%2Fwww.lipsum.com%2F%22%20class%3D%22placeholder-tool%20helpTool-placeholder%22%20scrolling%3D%22no%22%20frameborder%3D%220%22%3E%3C%2Fiframe%3E" data-cke-real-node-type="1" alt="IFrame" title="IFrame" align="" src="http://testsite.com/sites/all/libraries/ckeditor/images/spacer.gif?t=C9A85WF" data-cke-real-element-type="iframe" data-cke-resizable="true">
这是我不想要的。我想让 ckeditor 打印精确的 iframe 标签,而不是像这样的 img 标签。
<iframe src="http://www.lipsum.com/"></iframe>
这样,如果我想在 iframe 中执行任务,我就可以在编辑器中执行该任务。
先感谢您
补充2:
我需要 iframe 应该在编辑器本身中工作。它也不应该在节点添加或编辑页面上将 iframe 转换为 img。
It should like this
Not like this
最后,我必须在 ckeditor.js 的第 8194 行处进行一行更改:
return m.createFakeParserElement(p, 'cke_iframe', 'iframe', true);
To
return p;
所以它不是为 iframe 创建 FakeParser。当我将 iframe 置于编辑模式时,我看到的 iframe 完全不是图像。
这是我用于此功能的一个小技巧。
谢谢达科在这方面的帮助。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)