I have a problem that I have been struggling with.
If I want to embed iframes in TinyMCE it look okej in the editor, but on save, publish or html-preview everything is gone. I have tried updateing valid elements - both in the config and in tinymce js-file. But nothing works.
The above looks like it should have worked...did you touch the web.config to apply the changes after you updated the tinyMceConfig.config ?
On a side note, it might be a better idea to use a macro instead. You could create a macro called "Insert IFrame", allow it in the editor, and give it parameters like SRC URL, Width, Height, etc. Or if this is only to be used for YouTube you could call the macro "Insert Youtube Embedded Video" and tailor the parameters to make it easier for the editor. Let us know if you need any guidance on that..
Thanxs for reply, yes i touched web.config and it is generally an iframe, not just youtube - I have been thinking about making macro instead. But I realy would like it to work the "right" way. I have tried before in othter projects but never got it to work - someone must have been able to do it.
It seems that somewhere (not in tinymce) it gets cleaned away - because it is woking in the editor.
Sean is right that setting TidyEditorcontent to false will allow you to add an iframe in the RTE field. However I don't think it's the best solution. I think you should aim for what Tom is suggesting even though it's a bit cumbersome.
But disabling tidy has it downsides, which can make it hard to maintain and control what editors are able to add on the page. But it's of course dependent on the scale of the project etc.
Turning off Tidy is not an option, especially when we have users copying nasty formatted Word text. There must be a way to stop TinyMCE or Tidy from stripping the iFrame.
We created and are using the Widget Dropper package to work around the multitude of problems with TinyMCE and markup it so eagerly wants to strip, mangle, or incorrectly render. Yes it has a silly name but the problem it solves is also very silly, hence why it seems to fit so well. I think you can probably also find other similar packages to work around this problem, though none come to mind off the top of my head.
TinyMCE can clean up Word content. Take a look at this plug in (http://www.tinymce.com/wiki.php/Plugin%3apaste) which auto cleans Word. You'll never find a 100% bullet proof solution but then once we hand over a site to a client it out of your hands anyway, you can only do so much.
Another route is to remove the need for a iframe at all (have whatever needs pasting as separate fields on a custom doctype) but this gets messy if a document starts out as a vanilla doctype but then they want to add a youtube video in the future, you can't change the doctype easily.
Finaly route is to maybe us a macro instead which the users can insert into the RTE which would render out when needed.
Bottom line, the version of TinyMCE/Tidy that ships with Umbraco 4.7 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.
Allow iframe in TinyMCE
Hi,
I have a problem that I have been struggling with.
If I want to embed iframes in TinyMCE it look okej in the editor, but on save, publish or html-preview everything is gone. I have tried updateing valid elements - both in the config and in tinymce js-file. But nothing works.
Any help or input would make me happy.
This is what I have tried
And this I try to embed
Hi Jonathan,
The above looks like it should have worked...did you touch the web.config to apply the changes after you updated the tinyMceConfig.config ?
On a side note, it might be a better idea to use a macro instead. You could create a macro called "Insert IFrame", allow it in the editor, and give it parameters like SRC URL, Width, Height, etc. Or if this is only to be used for YouTube you could call the macro "Insert Youtube Embedded Video" and tailor the parameters to make it easier for the editor. Let us know if you need any guidance on that..
-Tom
Hi Tom,
Thanxs for reply, yes i touched web.config and it is generally an iframe, not just youtube - I have been thinking about making macro instead. But I realy would like it to work the "right" way.
I have tried before in othter projects but never got it to work - someone must have been able to do it.
It seems that somewhere (not in tinymce) it gets cleaned away - because it is woking in the editor.
/Jonathan
Have you tried setting the TidyEditorCotent to false in the umbracoSettings.config file:
I believe that is the only way that we got it to work.
-Sean
Sean is right that setting TidyEditorcontent to false will allow you to add an iframe in the RTE field. However I don't think it's the best solution. I think you should aim for what Tom is suggesting even though it's a bit cumbersome.
But disabling tidy has it downsides, which can make it hard to maintain and control what editors are able to add on the page. But it's of course dependent on the scale of the project etc.
/Jan
Hi again
Have you had a look at the uTube package? Maybe that could be an option?
/Jan
In case anyone else has this same problem (like I did just now) the correct TinyMCE rules are:
iframe[title|class|type|width|height|src|frameborder|allowFullScreen]
pipes instead of commas, simple mistake but makes all the difference :)
And yes you need to turn off Tidy in the settings too (as this cleans it server side).
Hope that helps.
Turning off Tidy is not an option, especially when we have users copying nasty formatted Word text. There must be a way to stop TinyMCE or Tidy from stripping the iFrame.
We created and are using the Widget Dropper package to work around the multitude of problems with TinyMCE and markup it so eagerly wants to strip, mangle, or incorrectly render. Yes it has a silly name but the problem it solves is also very silly, hence why it seems to fit so well. I think you can probably also find other similar packages to work around this problem, though none come to mind off the top of my head.
Best of luck!
TinyMCE can clean up Word content. Take a look at this plug in (http://www.tinymce.com/wiki.php/Plugin%3apaste) which auto cleans Word. You'll never find a 100% bullet proof solution but then once we hand over a site to a client it out of your hands anyway, you can only do so much.
Another route is to remove the need for a iframe at all (have whatever needs pasting as separate fields on a custom doctype) but this gets messy if a document starts out as a vanilla doctype but then they want to add a youtube video in the future, you can't change the doctype easily.
Finaly route is to maybe us a macro instead which the users can insert into the RTE which would render out when needed.
Cheers
Pete
Bottom line, the version of TinyMCE/Tidy that ships with Umbraco 4.7 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.
Hi Connie,
In that case I suggest you raise a ticket in the issue tracker so they can take a look (http://umbraco.codeplex.com/workitem/list/basic)
Remember to include a link to this thread and some sample code/steps to recreate the problem quickly.
Pete
is working on a reply...