ckeditor add< iframe>标签 [英] ckeditor add <iframe> tag in editor

查看:303
本文介绍了ckeditor add< iframe>标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在drupal 7网站使用ckeditor。我想把iframe标签放在编辑器中。
目前当我们将iframe放在ckeditor中时会发生什么。

 < iframe src =http: lipsum.com/\"> ;</iframe> 

它将iframe标记转换为带有一些特殊属性和URL的img标记。

 < img class =cke_iframedata-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 =1alt =IFrametitle =IFramealign =src =http://testsite.com/sites/all/libraries/ckeditor/images/spacer。 gif?t = C9A85WFdata-cke-real-element-type =iframedata-cke-resizable =true> 

我不想要的。我想让ckeditor打印精确的iframe标签有没有img标签这样。

 < iframe src =http://www.lipsum.com/>< / iframe> 

这样,如果我想在iframe中执行任务,所以我可以在编辑器中执行。 / p>

提前感谢您



加2: b

我需要iframe应该在编辑器本身工作。它不应该将iframe转换为img在节点添加或编辑页面。





它应该这样



不喜欢这样
< a href =https://i.stack.imgur.com/3wqOx.png =nofollow noreferrer>

解决方案

最后,我必须在库的ckeditor.js文件中进行一行更改。我在该文件中做了以下更改: -



第8194行: -


return m.createFakeParserElement(p,'cke_iframe',
'iframe',true);


p>


return p;


为iframe创建FakeParser。当我把一个iframe在编辑模式,所以我看到的iframe完全不是图像的地方。



感谢Darko对此的帮助。


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>

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">

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>

So that If I want to perform a task in iframe so I can do that inside the editor.

Thank you in advance

Addition 2:

I need the iframe should work in editor itself. It should not convert iframe to img on node add or edit page also.

It should like this

Not like this

解决方案

Finally, I have to make one line change in ckeditor.js file of library for this. I made following changes in that file: -

Line No. 8194: -

return m.createFakeParserElement(p, 'cke_iframe', 'iframe', true);

To

return p;

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.

Thank you Darko for help on this.

这篇关于ckeditor add&lt; iframe&gt;标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆