How can I get Sitecore Field Renderer to use a css class for an image

[亡魂溺海] 提交于 2019-12-06 15:33:42
Benutzer

This was what I was looking for:

@Html.Sitecore().Field("MyFieldName", myItem, new { Parameters = new SafeDictionary<string> { { "enclosing-tag", "h2" } } })

See Extending the Sitecore RenderField pipeline.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!