Getting iframe tag to work in TinyMCE

If iframe tag does not work in TinyMCE (ie when iframe tag is inserted into the HTML editor, the code is simply removed), it must be enabled by modifying the tinyMCE.init function in the application and adding the extended_valid_elements option:

tinyMCE.init({
  ...
  extended_valid_elements : "iframe[src|allowfullscreen|frameborder|style|scrolling|class|width|height|name|align]"
});

This will make the iframe tag immediately available in the editor.

To check if the new settings have been added, tinyMCE.settings.extended_valid_elements can be typed into the Firefox or Chrome console.

Comments

Popular posts from this blog

How to resolve 'res://ieframe.dll/acr_error.htm#' error (Internet Explorer stopped working while viewing a website)

htaccess: Redirecting multiple domains to the main domain

MailChimp API V2.0 SSL error solution