When I was using WYSIWYG template plugin - 6.x-1.0 beta1 , I was successfully adding custom attribute to image tag with Jquery but when I upgraded it to 6.x-2.6 it is stopping me from adding any custom attribute to image tag. What I found is that on line #105 in wysiwyg_template.module of 6.x-2.6, it is mentioned that only those extended elements are valid.
'extended_valid_elements' => array( //tinymce specific - allows additional elements to be used
'img[id|class|src|border=0|alt|title|width|height|align|name|style]',
),
can anyone help me in this case?

Thanks in advance for any upcoming help.

Comments

guybedford’s picture

It appears that TinyMCE restricts content to valid elements, using these rules - http://www.tinymce.com/wiki.php/Configuration:valid_elements.

As far as I can tell, TinyMCE doesn't have support for custom attributes unless you specify them exactly in this valid elements array or the extended valid elements data.

You should be able to ammend this with a wysiwyg hook I believe - but it seems you would have to individually specify any custom attributes you use as I can't see the use of a wildcard attribute rule in the above documentation.

Hope that helps.

guybedford’s picture

Status: Active » Closed (works as designed)