Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jonathan Cohen 40 posts 115 karma points
    Jan 31, 2011 @ 19:27
    Jonathan Cohen
    0

    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

    iframe[title,class,type,width,height,src,frameborder,allowFullScreen]

    And this I try to embed

    <iframe title="YouTube video player" class="youtube-player" type="text/html" 
    width="640" height="390" src="http://www.youtube.com/embed/rYgQnKdrh2A?rel=0"
    frameborder="0" allowFullScreen></iframe>
  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jan 31, 2011 @ 19:47
    Tom Fulton
    2

    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

  • Jonathan Cohen 40 posts 115 karma points
    Jan 31, 2011 @ 20:11
    Jonathan Cohen
    0

    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

     

  • Sean Mooney 131 posts 158 karma points c-trib
    Jan 31, 2011 @ 20:41
    Sean Mooney
    1

    Have you tried setting the TidyEditorCotent to false in the umbracoSettings.config file:

    <!-- clean editor content with use of tidy -->
    <TidyEditorContent>False</TidyEditorContent>

    I believe that is the only way that we got it to work.

    -Sean

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 31, 2011 @ 20:51
    Jan Skovgaard
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 31, 2011 @ 20:55
    Jan Skovgaard
    0

    Hi again

    Have you had a look at the uTube package? Maybe that could be an option?

    /Jan

  • Peter Duncanson 430 posts 1360 karma points c-trib
    Jun 28, 2012 @ 13:50
    Peter Duncanson
    1

    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.

  • Connie DeCinko 931 posts 1160 karma points
    Aug 13, 2012 @ 22:29
    Connie DeCinko
    0

    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.

     

  • Funka! 398 posts 661 karma points
    Aug 14, 2012 @ 00:30
    Funka!
    0

    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!

  • Peter Duncanson 430 posts 1360 karma points c-trib
    Aug 14, 2012 @ 11:42
    Peter Duncanson
    0

    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

  • Connie DeCinko 931 posts 1160 karma points
    Aug 14, 2012 @ 17:44
    Connie DeCinko
    0

    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.

  • Peter Duncanson 430 posts 1360 karma points c-trib
    Aug 14, 2012 @ 18:32
    Peter Duncanson
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft