Not set a Height/Width of embedded image within WYSIWYG

birwin's Avatar


28 Jun, 2016 05:37 PM

Hi there, not sure if this is possible, but we're setting up some responsive templates within Cascade and found that when you use the WYSIWYG to embed an image, it auto adds in a height and width attribute into the HTML.

While in theory this is not a bug, - on a responsive page, we need the image to more or less not have that height and width set so it can assume 100% of the space available to it. Is there a way to make it so that the WYSIWYG does not add these attributes.

Currently we use the HTML view remove them, but hoping to automate the process.

  1. 1 Posted by Wing Ming Chan on 28 Jun, 2016 07:27 PM

    Wing Ming Chan's Avatar

    Hi Brendon,

    Before we moved onto file choosers in data definition blocks, I used the template-level format to remove the width and height attributes of img. I could also use web services to modify pages directly. Now we teach users not to insert images directly into a WYSIWYG, the main reason being that we want to use srcset.


  2. 2 Posted by Ryan Griffith on 28 Jun, 2016 08:12 PM

    Ryan Griffith's Avatar


    The issue is the TinyMCE plugin adds these dimensions, and I am pretty sure does not allow for percentages either. Wing's proposed solution is what I generally recommend. To go a step further, you could use XPath to further target specific images.

    Please let me know if you have any questions.


  3. 3 Posted by birwin on 28 Jun, 2016 08:51 PM

    birwin's Avatar

    I thought this may be the case.

    It’s a bit of a catch because there are instances where we will want to set this attribute.

    As Wing suggested, I think we’ll have to go the teaching route. Many thanks!


  4. Tim closed this discussion on 28 Jun, 2016 09:27 PM.

Discussions are closed to public comments.
If you need help with Cascade CMS please start a new discussion.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac


26 Aug, 2016 01:19 PM
25 Aug, 2016 03:02 PM
25 Aug, 2016 12:50 PM
24 Aug, 2016 08:43 PM
24 Aug, 2016 07:20 PM
21 Aug, 2016 01:20 PM