I would like a button that allows users to insert an iframe

Comments

dczepierga’s picture

Status: Active » Closed (won't fix)

This issue is inactive over half year, so i closed it.

astutonet’s picture

Status: Closed (won't fix) » Active

I was looking for a way to use iFrame with the CKEditor. So I found this example on the official site CKEditor: http://ckeditor.com/demo.

This feature is available for version 6.x of the CKEditor module?

Can we use it? How? Or are there other options?

Thank you!

dczepierga’s picture

@astutonet, try to add button IFrame to your toolbar, then it will be displayed there - try also switch to full HTML text format, because probably filtered HTML will strip this tag.

Greetings

astutonet’s picture

Category: feature » support

Ok @dczepierga. Let's go.

I'm using the version 6.x-1.x-dev of the CKEditor module and the version 3.5.3 of the software.

I seached for information, in different places, to activate the iframe button in the toolbar, but I didn't find any reference to explain me how I can do this.

I believe it is necessary to insert some information in the file ckeditor.config.js. I'm right?

I think I'll need help to enable this feature ...

Thank!

mkesicki’s picture

@astutonet just add 'Iframe' button to your toolbar configuration in ckeditor.config.js file.
Why you use so old version of CKEditor? Recently 3.6.2 version arrived, I think that update to it is good idea.

astutonet’s picture

@michal_cksource, I did the following:

I updated the software to version 3.6.2. That done, I edited the file ckeditor.config.js and I added the 'Iframe' command on the DrupalFull toolbar, which is standard on the site, as follows:

  config.toolbar_DrupalFull = [
      ['Source'],
      ['Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellChecker', 'Scayt'],
      ['Undo','Redo','Find','Replace','-','SelectAll','RemoveFormat'],
      ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'],
      '/',
      ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
      ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
      ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiRtl','BidiLtr'],
      ['Link','Unlink','Anchor','Linkit','LinkToNode', 'LinkToMenu'],
      '/',
      ['Format','Font','FontSize'],
      ['TextColor','BGColor'],
      ['Maximize', 'ShowBlocks'],
      ['DrupalBreak', 'DrupalPageBreak'],
      ['Iframe']
     ];

I also tried using "IFrame", "iframe" and "iFrame". Unfortunately, these settings were not sufficient to work of the button 'Iframe'.

Any idea?

Thank you!

mkesicki’s picture

It should be 'Iframe'. Please check if you use correct toolbar in your CKEditor's profile . Clear browser and drupal cache is also good idea.

astutonet’s picture

Ok.

Now the button of 'Iframe' is displayed and it's working, but the Iframe isn't displayed in the node, when I'm viewing it.

Is there any definition, permission or special configuration to display iframes on nodes?

Thank you.

dczepierga’s picture

Try to change input format to Full HTML, or add in Filtered HTML input format configuration "iframe" tag and then it wouldn't be stripped.

Greetings

dczepierga’s picture

Status: Active » Postponed (maintainer needs more info)
astutonet’s picture

Status: Postponed (maintainer needs more info) » Active

Ok.

The Full HTML input format is the default on site. The tag "iframe" was added to the input formats allowed.

That done, I created a test page using an Iframe. The cache was clean.

The Iframe is not displayed when viewing the page and there is no any information about iframes in the page code.

When the page is edited, the follow code is present in the CKEditor:

<iframe align="left" frameborder="0" height="450" longdesc="Iframe Test Page" scrolling="yes" src="http://www.mysite.com/page" width="450"></iframe>

This site uses a custom theme. I've been checking the standards themes of Drupal and there isn't any information about iFrames in the style.css files, so I believe it is not necessary to enter settings about iframes on the css files.

Apparently we have a problem with filters and input formats because the code displayed by CKEditor is correct.

I did a test by disabling some filters and I found that when the Emogrifier filter is disabled , the iframe is displayed correctly.

The Emogrifier filter should only convert stylesheets to inline style rules for better compatibility with email and mobile device viewers, and this resource is necessary in the site.

We have a conflict between modules and resources? What to do?

mkesicki’s picture

Status: Active » Postponed (maintainer needs more info)

Try disable all unnecessary filters. You can also try change order in which filters are fired (link like /admin/settings/filters/1/order). If you try this and this doesn't help please create new ticket about CKEditor module and "Emogrifier" filter issue. Create link between new and this ticket.

astutonet’s picture

Status: Postponed (maintainer needs more info) » Active

Change the order of the filters don't solve the issue. Only when the Emogrifier is disable the Iframes are showed.

If the problem is in Emogrifier, the new ticket should be created in that area, right?

I will await your response to create the new ticket.

Tks.

dczepierga’s picture

Status: Active » Postponed (maintainer needs more info)

@astutonet, could u check one more thing: if u disable CKEditor module and add iframe in the textarea, after save it would be displayed or not (with Emogrifier module enabled)?

If it wouldn't be displayed it is Emogrifier bug and u should report this in their bugtracker, if not it could depend on CKEditor module and u should write this issue on CKEditor bugtracker.

Greetings

astutonet’s picture

Status: Postponed (maintainer needs more info) » Active

@dczepierga, I did a test and after disabling CKEditor, I created a page, inserting an iframe. When you visualize the page, the Iframe is not displayed. So I disabled the filter Emogrifier and updated the page, at which time the Iframe was displayed correctly.

For this reason, I created this ticket.

Thank you.

dczepierga’s picture

Status: Active » Postponed

Ok thx for your reply. We will see wht they say, and then maybe we can do something with it.

Greetings