ckeditor 添加 <iframe>编辑器中的标签 [英] ckeditor add <iframe> tag in editor
问题描述
我在 drupal 7 站点中使用 ckeditor.我想将 iframe 标签放在编辑器中.目前当我们将 iframe 放入 ckeditor 时会发生什么.
I am using ckeditor in a drupal 7 site. I want to put iframe tag inside the editor. Currently what happen when we put iframe in ckeditor.
<iframe src="http://www.lipsum.com/"></iframe>
它将 iframe 标记转换为带有一些特殊属性和 URL 的 img 标记.
It convert that iframe tag with a img tag with some special attribute and URL.
<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 标签.
Which I do not want. I want to make the ckeditor to print exact iframe tag there not the img tag like this.
<iframe src="http://www.lipsum.com/"></iframe>
这样如果我想在 iframe 中执行任务,我就可以在编辑器中完成.
So that If I want to perform a task in iframe so I can do that inside the editor.
提前致谢
添加 2:
我需要 iframe 应该在编辑器本身中工作.它也不应该在节点添加或编辑页面上将 iframe 转换为 img.
I need the iframe should work in editor itself. It should not convert iframe to img on node add or edit page also.
应该是这样的
不是这样的
推荐答案
最后,我必须在 ckeditor.js 中的第 8194 行进行一行更改:
Finally, I have to make one line change in ckeditor.js at line number 8194:
return m.createFakeParserElement(p, 'cke_iframe', 'iframe', true);
到
return p;
所以它不是为 iframe 创建 FakeParser.当我将 iframe 置于编辑模式时,我看到的是 iframe,而不是图像.这是我用于此功能的一个小技巧.
So it is not creating FakeParser for iframe. And when I put a iframe in edit mode so I see the iframe exactly not the image in place of that. It is a little hack I used for this functionality.
感谢 Darko 在这方面的帮助.
Thank you Darko for help on this.
这篇关于ckeditor 添加 <iframe>编辑器中的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!