z00*_*ble 5 sitecore sitecore-mvc glass-mapper sitecore8
我们在Sitecore 8.1 Update 1 MVC中使用GlassMapper 4.0.5.54.问题是,渲染ImageField时,高度和宽度属性都写在img-tag中 - 但仅限于页面编辑器模式.
我们尝试了不同的方法
@Html.Glass().RenderImage(Model, x=> x.ImageField, outputHeightWidth:false, isEditable:true, parameters:new {mw = 1218, mh = 530})
@Html.Glass().Editable(x => x.ImageField, new { mw = 1218, mh = 530, width = (string)null, height = (string)null })
Run Code Online (Sandbox Code Playgroud)
但我们总能得到
<img src="http://url_to_local_website/-/media/image_1218x530.jpg?h=530&la=en&mh=530&mw=1218&w=1216&hash=452505F9D5896956CB6B0F284755555217E62D8A" alt="Alt Text" width="1216" height="530" sc-part-of="field" class="scEnabledChrome">
Run Code Online (Sandbox Code Playgroud)
因此,即使使用显式参数,outputHeightWidth:false它也会在页面编辑器中输出宽度和高度属性并扭曲图像.有什么建议?或者这是一个错误?
在对Glass Mapper ImageParameters的评论中,其他人提到了相同的行为.但是没有答案.
| 归档时间: |
|
| 查看次数: |
870 次 |
| 最近记录: |