Tag Archives: Xslt

Clean xslt loops with Sitecore and .net

The second time I found myself in this position, I felt I couldn’t get away with it again. Not because of anyone else, simply because it felt wrong. There’s a very low chance this is your second read-through (it’s not old code you wrote), so you probably don’t know what I’m talking about. Please bear with me for a moment as I get to the point.

What happened is that I had to build something similar to something else I build (a bit too quickly) a few weeks before, and of course I went back to take a look in the code. What I noticed was that I found it hard to read, and hard to understand what was supposed to happen when all the code had run. I won’t post all the code here, primarily because I don’t have it anymore but I’ll do my best to reconstruct the part I actually wanted to talk about.
Continue reading

Exposing .net object to xslt file in Sitecore

I’ve used this solution a long time now, it works great. The main idea is to provide the same object to not only my .net classes but also my xslt files. The first time I found myself in this position, I was looking for a way to pass application settings to my xslts without having to read the same sitecore item more than once per request.
Continue reading