添加
当我将 iframe 代码直接粘贴到 TinyMCE 的源代码视图中并单击保存时,它将代码更改为:
保存后查看 TinyMCE 代码添加 </p>
<iframe src="http://maps.google.co.uk/maps" width="425" height="350" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></p></iframe>
查看 HTML 的 HTML 源代码页面:
<iframe src="http://maps.google.co.uk/maps" width="425" height="350" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"/>
原始 iframecode
<iframe src="http://maps.google.co.uk/maps" width="425" height="350" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
这会影响页面布局的其余部分并破坏页脚。
如果有帮助的话,我正在使用 Silverstripe 2.4.5。
When I paste the iframe code directly into the source code view of TinyMCE and click save it changes the code to:
View TinyMCE code after saving adds </p>
<iframe src="http://maps.google.co.uk/maps" width="425" height="350" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></p></iframe>
View HTML source of HTML page:
<iframe src="http://maps.google.co.uk/maps" width="425" height="350" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"/>
Original iframecode
<iframe src="http://maps.google.co.uk/maps" width="425" height="350" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
This is effecting the rest of the page layout and breaks the footer.
I am using Silverstripe 2.4.5 if this helps.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
TinyMCE 不太喜欢 iframe。至少有三个(或多或少)快速修复:
如果仅适用于 Google 地图且始终处于固定位置,则可以使用 Addressable 模块:http://deadlytechnology.com/silverstripe/google-map-module/
如果仅适用于 Google 地图,但仅适用于
$Content
字段中的任何位置,您可能需要尝试短代码:http://www.ssbits.com/tutorials/2010/2-4-using-short-codes-to-embed-a-youtube-video/" ssbits.com/tutorials/2010/2-4-using-short-codes-to-embed-a-youtube-video/修复 TinyMCE 的混乱在服务器端的
onBeforeWrite()
方法中:http://www.silverstripe.org/general-questions/show/16438#post305472如果你能用2.,看一下完整的例子:
TinyMCE is not too much of an iframe fan. There are at least three (more or less) quick fixes:
If it's only for Google maps and always at a fixed position, you can use the Addressable module: http://deadlytechnology.com/silverstripe/google-map-module/
If it's only for Google maps but just anywhere in the
$Content
field, you might want to try short codes: http://www.ssbits.com/tutorials/2010/2-4-using-short-codes-to-embed-a-youtube-video/Fix TinyMCE's mess on the server side within the
onBeforeWrite()
method: http://www.silverstripe.org/general-questions/show/16438#post305472If you can use 2., take a look at a complete example:
实际上,最简单的解决方案是在 TinyMCE 中单击 HTML 小图标(锚点旁边),然后将 iframe 代码粘贴到此处。这样它就不会将 html 标签替换为
</p>
Actually the easiest solution is in the TinyMCE click the little HTML icon (next to the anchor) and then paste the iframe code there. This way it will not replace the html tags to
</p>