Try our conversational search powered by Generative AI!

How to exclude width/height from tinymce insert image function?


We have a responsive site..and can not really enjoy they attributes that comes with the tinymce image insert button... 

Is there any way to get rid of it?

Edited, Aug 24, 2016 12:16

You should be able to use the valid_elements property in a TinyMCEPluginNonVisual. There you can make sure that the TinyMCE-instance removes height and width by itself.

It's probably wise to strip them out using Save events on the server side as well. Then you won't get any surprises if for example someone starts saving HTML from some source programatically.

Aug 31, 2016 21:56

Not exactly what I want :-)

I want to be able to use width and hight (manually), but the button itself should not inject the attributes.

How can I alter the behaviour of the button?

Sep 01, 2016 8:52

OK, after 7.6 it's hard to "hack" the original plugin so best way is to copy it  as your own plugin, maybe an option could be to work some URL rewrites and catch the script in question and just make a little modification.

The documentation have some info:

Sep 01, 2016 10:44

Fredrik, did you solve this? to no fill in automatically the fields... 

My customer gets totaly wrong propotions too... 

Apr 25, 2018 9:53
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.