Glass.Mapper icon indicating copy to clipboard operation
Glass.Mapper copied to clipboard

BuildImageUrl with Image properties

Open Swimburger opened this issue 8 years ago • 2 comments
trafficstars

When using Glass we used the Src property to set a background image via inline CSS. Recently we noticed that the width, height, maxwidth, maxheight, ... properties from Sitecore were being ignored. Example code:

<section style="background: url('@Model.HeaderImage.Src')">
     ...
</section>

Looking into the source code I see that the properties are being appended onto the image URL when using RenderImage(). It would be useful to have an option to only render the Image URL so we can add it as a background image. Fe BuildImageUrl()

Swimburger avatar Apr 09 '17 14:04 Swimburger

Thanks, we will investigate. I am sure we had this request before and done something.

mikeedwards83 avatar Apr 13 '17 14:04 mikeedwards83

Did you find more info about someone else requesting this? If not, I can look into adding this new function.

Swimburger avatar May 05 '17 11:05 Swimburger