I'm trying to enable iframe tags in tinyMCE v3 RTE. I know they're not enabled by default.
I added iframe to the valid_elements config file for tinyMCE, and this worked great. However, today, it stopped working for no (apparent) reason. Now, whenever someone tries to add an iframe tag via the RTE HTML mode, it shows up, but the minute you click save or publish, it disappears. I've tried removing, re-adding it from the config file. Also bouncing IIS. Nothing.
It is unlikely that a feature or a change would revert for no reason. Has something changed in your configuration eg did you recently upgrade your umbraco installation or has your config file been reverted to an older version?
Figured this out. Absolutely nothing wrong with TinyMCE - its simply a usability quirk. TinyMCE won't allow empty tags, so if you put in <iframe src="xxx"></iframe> it simply removes it. You have to add something like No Frames text between the tags and then it works fine!
Now this does allow the IFRAME tab to be added into TinyMCE itself - I copied and pasted into the HTML view and after clicking "update" the IFRAME was still in the WYSIWYG editor. However when you click save - it disappears!
I tried Mark's suggestion, but even adding text inbetween <iframe></iframe> tags doesn't work. Somthing else is removing my tags! I know I could use a macro to construct this but I'd prefer to to provide flexibility via the RTE rather than have to decorate my templates with macros for what is simply content.
Did you restart the application after you changed the tinymcesettings? (You can restart it by touching the web.config). If you didn't, the changes do not take effect.
Alternatively, you can disable the checking by editing the umbracoSettings.config and setting TidyEditorContent to false. (remember to restart the application after you make the changes).
Adding iframe[width|height|src|frameborder|scrolling|marginheight|marginwidth]] (no spaces!) to tinyMceConfig.configand iisrestart worked like a charm in Umbraco 4.6.1! Thanks!
I've added the string to the configuration file but it's still not showing up. Since I don't have access to do a full IISRESET (Godaddy shared hosting) I've recycled the application pool, is that enough?
Personally I've never had any luck getting iframes to insert in
TinyMCE. Kind of surprised Njal got it working. Are you using 4.6.1 like he is?
I always just use a generic macro like "Insert IFrame" and add
parameters like URL, frameborder, width, height, etc and allow it to be
used in the editor. Not sure if that is an option for you or not..
Ive got the same problem on a v4.0.2.1 The string should end with three brackets as the pasted code has, you've got two in the CDATA, and one in iframe-attributes.
Bottom line, the version of TinyMCE/Tidy that ships with Umbraco is broken by not allowing iframes even though they are allowed in the TinyMCE config. Tidy should not be stripping out the empty iframe tag. And, TinyMCE should not be removing content inside the iframe tag, which is your no frames content.
TinyMCE Woes...
I'm trying to enable iframe tags in tinyMCE v3 RTE. I know they're not enabled by default.
I added iframe to the valid_elements config file for tinyMCE, and this worked great. However, today, it stopped working for no (apparent) reason. Now, whenever someone tries to add an iframe tag via the RTE HTML mode, it shows up, but the minute you click save or publish, it disappears. I've tried removing, re-adding it from the config file. Also bouncing IIS. Nothing.
Any ideas?
We're using V4 of Umbraco.
Thanks!
It is unlikely that a feature or a change would revert for no reason. Has something changed in your configuration eg did you recently upgrade your umbraco installation or has your config file been reverted to an older version?
I agree - its unlikely something would change for no reason. But no upgrades have been done, and the config file is the same version....
Figured this out. Absolutely nothing wrong with TinyMCE - its simply a usability quirk. TinyMCE won't allow empty tags, so if you put in <iframe src="xxx"></iframe> it simply removes it. You have to add something like No Frames text between the tags and then it works fine!
Do'h!
I tried both of these ... added iframe to the TinyMCS config and tried adding text inbetween <iframe></iframe> tags ... still no joy!
I can see the IFRAME in the editor window, but as soon as I save/publish, it goes!
Help!
Untested, but try adding iframe and it's attributes under the ValidElements node in /config/tinymceSettings.config
HTH,
Simon
Thanks Simon,
I had tried your suggestion, added the following:
iframe[width|height|src|frameborder|scrolling|marginheight|marginwidth]
Now this does allow the IFRAME tab to be added into TinyMCE itself - I copied and pasted into the HTML view and after clicking "update" the IFRAME was still in the WYSIWYG editor. However when you click save - it disappears!
I tried Mark's suggestion, but even adding text inbetween <iframe></iframe> tags doesn't work. Somthing else is removing my tags! I know I could use a macro to construct this but I'd prefer to to provide flexibility via the RTE rather than have to decorate my templates with macros for what is simply content.
Using Umbraco 4.0.2.1.
Did you restart the application after you changed the tinymcesettings? (You can restart it by touching the web.config). If you didn't, the changes do not take effect.
Alternatively, you can disable the checking by editing the umbracoSettings.config and setting TidyEditorContent to false. (remember to restart the application after you make the changes).
HTH,
Peter
Adding iframe[width|height|src|frameborder|scrolling|marginheight|marginwidth]] (no spaces!) to tinyMceConfig.configand iisrestart worked like a charm in Umbraco 4.6.1! Thanks!
-N
Hi Njal,
Where did you add this in umbracoSettings.config ?
Thanks,
kukuwka
I think he meant in tinyMceConfig.config, in the validElements section :)
Yep - tinyMceConfig.config !
I've added the string to the configuration file but it's still not showing up. Since I don't have access to do a full IISRESET (Godaddy shared hosting) I've recycled the application pool, is that enough?
Does anyone know what I'm doing wrong?
Hi Carlos
That should be enough. But perhaps you could also try to touch the web.config to see if that helps?
/Jan
Jan,
Thanks... but no luck :(
Do you know of any other tricks or workarounds i can use?
Personally I've never had any luck getting iframes to insert in TinyMCE. Kind of surprised Njal got it working. Are you using 4.6.1 like he is?
I always just use a generic macro like "Insert IFrame" and add parameters like URL, frameborder, width, height, etc and allow it to be used in the editor. Not sure if that is an option for you or not..
-Tom
i've tryed that also, didn't work. using 4.5.2
Try adding something inside your iframe tags so it doesn't get collapsed:
Your code looks wrong though Carlos... You have one too many brackets on the end and missing the one after 'button'
You have:
You should have:
Ive got the same problem on a v4.0.2.1
The string should end with three brackets as the pasted code has, you've got two in the CDATA, and one in iframe-attributes.
Did you guys solve this?
Works when turning off Tidy in umbracoSettings.config
<TidyEditorContent>False</TidyEditorContent>
Bottom line, the version of TinyMCE/Tidy that ships with Umbraco is broken by not allowing iframes even though they are allowed in the TinyMCE config. Tidy should not be stripping out the empty iframe tag. And, TinyMCE should not be removing content inside the iframe tag, which is your no frames content.
is working on a reply...