Ticket #11588 (confirmed Feature Request)

Opened 5 years ago

Last modified 4 years ago

TinyMCE does not allow IFRAMEs

Reported by: miohtama Owned by: robgietema
Priority: minor Milestone: 4.x
Component: Visual Editor Version:
Keywords: Cc: pelle

Description

It is not easy to embed IFRAMEs with TinyMCE (TinyMCE cleans them out from HTML source view). This makes embedding Google Maps impossible.

IFRAME is not controlled by site settings, but looks like it is TinyMCE's own dilemma. There is no site admin setting to override this behavior.

The problem plagues other CMS as well.

More info:

 http://wordpress.org/support/topic/google-maps-iframe-deleted-with-tinymce-and-advanced-tinymce

Change History

comment:1 Changed 5 years ago by thet

for me, this isn't the case - at least partially. when enabling iframe and setting it to 1 in /portal_transforms/safe_html/Plone/portal_transforms/safe_html/manage_workspace it isn't stripped out anymore and saved in the content type. however, when displaying the content type, the iframe seems to be stripped out. when editing it again, the iframe is still there. seems that this isn't a issue of tinyMCE...?

comment:2 Changed 5 years ago by miohtama

Ah, I was little unclear.

Here are my steps to repeat

  1. Go to Google Maps, get <iframe> code
  1. Go to Plone, add Page
  1. In TinyMCE, click edit HTML Source
  1. Paste in HTML snippet with <iframe>
  1. Switch back to WYSIWYG
  1. Switch back to HTML source

<iframe> is gone.

Does Plone filtering affect also 5. and 6. ?

comment:3 Changed 5 years ago by pelle

  • Cc pelle added

ran in to the same issue - look through the portal_transforms/safe_html / <site>/@@filter-controlpanel and there is apparently no iframe strip on the 'plone side'.

came across this note on iframe an tinymce  http://tinymce.moxiecode.com/forum/viewtopic.php?pid=58808 - but not sure if that approach(s) can be used.

pelle

comment:4 Changed 5 years ago by yusbu

I turned TinyMCE off, iframe is still gone miohtama suspect.

comment:5 Changed 5 years ago by beetleb

This works...

I did the above as suggested by Thet, to leave the iframe in the saved data, so it displays when you edit the page, but not when you view it. I then followed the instructions here:  http://www.tinymce.com/forum/viewtopic.php?pid=58808 (kind of). This suggests you edit the TinyMCE init adding:

extended_valid_elements : "iframe[src|width|height|name|align]",

There isn't an init file that I could find in the Plone implementation, but a search for 'extended_valid_elements' reveals this in buildout-cache/eggs/Products.TinyMCE-1.1.9-py2.6.egg/Products/TinyMCE/skins/tinymce/tiny_mce_src.js

extended_valid_elements : 0,

I simply put in the iframe string "iframe[src|width|height|name|align]" instead of the zero, restarted the instance and Bob's your uncle!

Obviously there needs to be some more permanent solution, but perhaps this change could just be added to the implementation of TinyMCE in Plone 4.

comment:6 follow-up: ↓ 9 Changed 4 years ago by jcerjak

  • Version set to 4.1

Is this still an issue? If I go to @@filter-controlpanel and add iframe to the custom tags list everything works, the iframe is not stripped out when displaying the content type and when editing it. Also switching back and forth to HTML source doesn't delete it.

I've tested this on Plone 4.0.3 and 4.2b2.

comment:7 Changed 4 years ago by jcerjak

  • Version 4.1 deleted

comment:8 Changed 4 years ago by kleist

  • Status changed from new to confirmed

comment:9 in reply to: ↑ 6 Changed 4 years ago by esteele

Replying to jcerjak:

Is this still an issue? If I go to @@filter-controlpanel and add iframe to the custom tags list everything works, the iframe is not stripped out when displaying the content type and when editing it. Also switching back and forth to HTML source doesn't delete it.

I've tested this on Plone 4.0.3 and 4.2b2.

The same works for me on 4.1.6.

Note: See TracTickets for help on using tickets.