添加

发布于 2025-01-05 20:52:12 字数 784 浏览 5 评论 0原文

当我将 iframe 代码直接粘贴到 TinyMCE 的源代码视图中并单击保存时,它将代码更改为:

保存后查看 TinyMCE 代码添加 </p>

<iframe src="http://maps.google.co.uk/maps" width="425" height="350" frameborder="0" marginwidth="0" marginheight="0" scrolling="no">&lt;/p&gt;</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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无所的.畏惧 2025-01-12 20:52:12

TinyMCE 不太喜欢 iframe。至少有三个(或多或少)快速修复:

  1. 如果仅适用于 Google 地图且始终处于固定位置,则可以使用 Addressable 模块:http://deadlytechnology.com/silverstripe/google-map-module/

  2. 如果仅适用于 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/

  3. 修复 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:

  1. 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/

  2. 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/

  3. Fix TinyMCE's mess on the server side within the onBeforeWrite() method: http://www.silverstripe.org/general-questions/show/16438#post305472

If you can use 2., take a look at a complete example:

浪推晚风 2025-01-12 20:52:12

实际上,最简单的解决方案是在 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>

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文