I am trying to specify certain iframes by using a class attribute to adjust the width using CSS.
The iframes I am working with are google maps embeds, similar to this one:
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.co.uk/?ie=UTF8&t=m&ll=52.8382,-2.327815&spn=4.646012,9.338379&z=6&output=embed"></iframe>
These iframes are copied and pasted into the HTML source editor of tinyMCE. However, I am facing an issue where the class attribute is being removed when I click update on the source editor.
I have attempted to use both valid_elements and extended_valid_elements in the configuration settings, but neither seem to work for iframe[class].
I am currently using version 3.4.3 of tinyMCE. Upon downloading version 3.5.7, I noticed that the same problem persists. This behavior can also be seen on the demo on the tinyMCE website despite claims in the documentation that the class attribute is supported.
Below is the full configuration code:
tinyMCE.init({
// General options
mode : "specific_textareas",
editor_selector : "formInputWysiwyg",
theme : "advanced",
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,wordcount,advlist",
// Theme options
... (remaining config details) ...
style_formats : [
{title : 'Google Maps', selector : 'iframe', classes : 'google-maps-embed'},
{title : 'Intro', selector : 'p', classes : 'intro'},
{title : 'News Image', selector : 'img', classes : 'news-image'}
],
});