Ok - I have searched thinking there has to be someone having this issue but nope. I also searched for iframe information but did not find much.

I want to have an iframe inside a page. So I started a page, and pasted it in. I am using tinymce. It did not work. Then I click the html button in tinymce, paste in code. Still didnt work. When I turn off tinymce, it works the first time.

However next time I come back to the page, tinymce loads again and kills the code.

How do I properly create an iframe that will not keep going away?

Thanks,
Allen

Comments

solson’s picture

I have the same problem.

mkalbere’s picture

I got the same problem, but only with IE and width Drupal 5.x. I went around for some informations couple of month ago, and if I remember well it's a tiny 2.x problem, solved in the 3.x version. Seems that upgrading to Drupal 6.x (witch work with Tiny 3.x) solve the issue

fozloki’s picture

Is there nobody who can help?

I also cannot use PHP format when tinymce is on, because tinymce breaks everything.

OK, found the solution

Verify HTML has to be turned off in tinymce settings. (Alternatively you can edit valid_elements in tiny_mce.js)

kvoltz’s picture

Its driving me nuts.

I have followed all the corrections - everything seems to be working correctly, but it just keeps killing my

codes. I am in 6.13 with the newest version of TinyMCE (3.2.5 I think) and the WYSIWYG API. what is the deal with this!? its driving me insane.
mkalbere’s picture

what do you mean:
- inserting en iframe within tiny ?
- or displaying tiny inside an iframe ?

bwho’s picture

The site I ran into this problem with is using older versions of TinyMCE (6.x-1.1-dev) and Drupal (6.12), but I found that setting 'Verify HTML' to false when editing the appropriate editor profile (at admin/settings/tinymce) works just fine.

If all else fails, you may also consider turning off the TinyMCE module and just entering the HTML straight into the node body (followed by re-enabling it, and not editing that node).

In both cases, make sure your input format is set correctly (I used unfiltered)...

irdkilpatrick’s picture

If you don't want to turn off HTML verification or mess about in the modules folder editing tiny_mce.js, you can make the change in the init script.

  1. Go to /admin/settings/tinytinymce
  2. Under "TinyMCE init script for advanced mode", find "extended_valid_elements :" It's followed by a list of tags that are allowed in advanced mode (but not in simple mode).
  3. Add the following to that list: "iframe[src|width|height|name|align|frameborder]"

Be sure to include all of the attributes (src, width, etc.) that you wish to allow.

Jenechka’s picture

file: /sites/all/modules/wysiwyg/editors/tinymce.inc
function: wysiwyg_tinymce_plugins()

find string #374 (may be another number)

  $plugins = array(

insert after this code

    'iframe' => array(
      'buttons' => array('iframe' => t('Iframe')),
      'extended_valid_elements' => array('iframe[src|width|height|name|align|frameborder]'),
    ),

Enable 'iframe' plugin in 'Buttons and plugins' at any wysiwyg profile (for example at /admin/settings/wysiwyg/profile/2/edit)

Enjoy google maps :)

awasson’s picture

Hi Jenechka,
Great solution for this. Thanks a lot!

To to make this a one button solution in the WYSIWYG UI module follow the instructions here then add Jenechka's patch. It works just the way it should.

Note: The one button solution requires a plugin called 'embed' that you need to download and insert into sites/all/libraries/tinymce/jscripts/tiny_mce/plugins/

More info on where to get the plugin here.

jhall89’s picture

Thank you for this bit of code. I was having to disable the editor every time I wanted to insert an iframe.

lcampanis’s picture