blog
Sitecore FieldRenderer - Images and the CssClass Bug

I just came across an interesting bug in Sitecore, in which the CssClass property of the FieldRenderer does not work when rendering an image. This is, apparently, a known bug, and the solution is to use the “class” parameter in the Parameters property of the FieldRenderer.

For example, the following will not work:

<sc:FieldRenderer runat="server" ID="frFirstListImage" CssClass=”imageLeft" FieldName="Image Field" />

Instead, use the following:

<sc:FieldRenderer runat="server" ID="frFirstListImage" Parameters="class=imageLeft" FieldName="Image Field" />
1 Comments
Post a Comment

 
  • Comment by Tom on Oct 16, 2016
    Thanks for this!