I don't want this to happen. I want to see the original image url output into the html that I've specified so that I can handle it responsively (e.g. assign a percentage width in css with a height of auto):
So why does Tiny MCE do that? Can it be stopped? I can understand if it gives the option to change it within the CMS, when adding the image. Maybe it's something to do with image gen?
Not sure why the styles are added instead of with="" and height="" attributes... But the alt text is currently being set to the name of the image if none is defined. It's based on a misconception about how the alt attribute should be used.
another approach could be to parse the richtext editor prior to render on the page. so don't use insert umbraco field.. and have your own macro to parse and remove via regex/xml dom manipulation/xslt... whatever floats your boat.
TypedMedia Url causing responsive image issues
Why do images with the following razor syntax cause inline styles and url's with querystring parameters?
Output:
<img style="width: 374px; height:49px;" src="/media/1005/testImg.png?width=374&height=49" alt="testImg.png" rel="1076" />
I don't want this to happen. I want to see the original image url output into the html that I've specified so that I can handle it responsively (e.g. assign a percentage width in css with a height of auto):
<img src="/media/1005/testImg.png" alt="" />
Can I stop this? Ideally as a one off, or even brute force across the entire site.
Hi Mark
What version of v7 are you using? And do you have any 3rd party packages installed?
/Jan
Hi Jan
Umbraco 7.1.4. I only have Archetype installed. It looks like Tiny MCE is updating this...
so it isn't a razor issue, sorry. It's Tiny MCE that generated the html
So why does Tiny MCE do that? Can it be stopped? I can understand if it gives the option to change it within the CMS, when adding the image. Maybe it's something to do with image gen?
Hi Mark
Not sure why the styles are added instead of with="" and height="" attributes... But the alt text is currently being set to the name of the image if none is defined. It's based on a misconception about how the alt attribute should be used.
You can vote up this issue if you would like it to be changed http://issues.umbraco.org/issue/U4-4734
Cheers, Jan
A brute force attack,,, could be urlrewrite. ie intercept requests to the media items and rewrite to ignore the querystring.
This could either be with urlrewriting.net in the core.. or urlrewrite at IIS level.
http://serverfault.com/questions/372991/iis-url-rewrite-module-query-string-parameters
another approach could be to parse the richtext editor prior to render on the page. so don't use insert umbraco field.. and have your own macro to parse and remove via regex/xml dom manipulation/xslt... whatever floats your boat.
is working on a reply...