Question on fixed image width/height when inserting an image via the editor
Hi folks,
Quick question: When inserting an image via the "Insert Picture" icon within the Richtext editor, is it possible to disable, turn off or otherwise stop Umbraco from setting a width and height value on the image when added to the page?
I ask because it seems to be fixing the height of the images thus causing distortion on responsive layouts.
It was me that had to create a responsive layout, would use the media picker datatype every place where it should be possible for the user to add images.
If you do it this way you can use the package ImageGen (developed by Douglas Robar) for image resizing, and in the last part of this uHangout episodeDoug talks about how you can use the ImageGen on a responsive site.
you have a couple of other opptions.. you can set config\tinymceConfig.config the <validElements> tag to not allow height and width for <img/> so on save/publish they are stripped (we had limited success with this)
an alternative is to create a macro to insert the content from the rte, rather than just inserting an umbraco field... and parse the height/width out
Apologues for the delay in my reply but thank you both very much for the suggestions and the videos - I found them both really interesting. I think for this particular case I can use a media picker as the placement will be in a fixed location within the template rather than, say, a bunch of images in a varying layout within the editor. Based on this it makes sense to use the media picker approach. I will be taking a look at the tinymceConfig file though to see what's possible here as that may be a solution for another project.
Question on fixed image width/height when inserting an image via the editor
Hi folks,
Quick question: When inserting an image via the "Insert Picture" icon within the Richtext editor, is it possible to disable, turn off or otherwise stop Umbraco from setting a width and height value on the image when added to the page?
I ask because it seems to be fixing the height of the images thus causing distortion on responsive layouts.
Thanks :)
Mike
Hi Mike,
It was me that had to create a responsive layout, would use the media picker datatype every place where it should be possible for the user to add images.
If you do it this way you can use the package ImageGen (developed by Douglas Robar) for image resizing, and in the last part of this uHangout episode Doug talks about how you can use the ImageGen on a responsive site.
http://uhangout.co.uk/#/view/_98Q0j2mE40
I hope that you can use this, or be inspired how you can use images in a responsive solution.
/Dennis
you have a couple of other opptions.. you can set config\tinymceConfig.config the <validElements> tag to not allow height and width for <img/> so on save/publish they are stripped (we had limited success with this)
an alternative is to create a macro to insert the content from the rte, rather than just inserting an umbraco field... and parse the height/width out
Something like that?
Oh and you might want to check out the mcv hybrid package.. with slimmage and slimresponse...
http://our.umbraco.org/projects/developer-tools/hybrid-framework
http://www.youtube.com/watch?v=BxOx-9jWF7A
Hi there Denis/Mike,
Apologues for the delay in my reply but thank you both very much for the suggestions and the videos - I found them both really interesting. I think for this particular case I can use a media picker as the placement will be in a fixed location within the template rather than, say, a bunch of images in a varying layout within the editor. Based on this it makes sense to use the media picker approach. I will be taking a look at the tinymceConfig file though to see what's possible here as that may be a solution for another project.
Much appreciated,
Mike
@Mike thanks the
is working on a reply...