A John of all trades, but mainly in body, mind, and IT.
Tag Archives: code
I’ve run into multiple situations where I’ve wanted to reuse most of a Sitecore sublayout/control with only one or two differences in the control’s properties. For example, this has happened when I have chunks of markup that are entirely identical … Continue reading
I spent hours trying to figure out how to set the class attribute of images rendered with the Sitecore FieldRenderer. Unfortunately, the CssClass attribute does not work on the FieldRenderer control as it does on the Image WebControl. Long after … Continue reading
To access the currently selected DateTime in the content editor’s preview mode, instead of checking the query string, use
Also, be sure to check if the page is in preview mode first. In my case, I had a presentation … Continue reading
I stumbled upon some puzzling code the other day. It makes me wonder, what sort of direction is your code going if this is what you end up with? Unnecessary code omitted (unlike the snippet) to increase clarity.