When Personalisation Breaks Rendering Parameters

Rendering parameters are used to allow editors to control the more presentation-oriented settings without editors needing to duplicate or clone their datasource items. However, I recently came on a situation where they seemed to break when an editor used personalisation to swap in a rendering that needed a different set of parameters to the original. I found a neat, if limited, solution that fit my needs and hopefully others may find it useful.

Custom Sitecore Configuration: Part 2, Objects

This post follows on from my introductory post about Sitecore configuration, where I talked about using settings and retrieving XML fragments.  In this post I talk about how you can use Sitecore configuration to instantiate and populate objects of your choosing.  This is useful for cutting down on the amount of mapping code you have […]

Custom Sitecore Configuration: Part 1, Introduction

I’ve spent quite a bit of time looking into the way that Sitecore configuration can be used.  It has some fairly novel features in it, and while it’s becoming less relevant as support for dependency injection in Sitecore matures, I don’t think it’s going anywhere.  All the same, it’s quite useful for adding flexibility to […]

Sitecore dynamic site provider

I did a bit of playing around recently with Sitecore’s SiteProvider infrastructure.  Our client wanted to be able to create new websites without needing a developer to set it up for them.  The nuts and bolts of sharing templates and renderings is already well documented, so I’m not going to go into that.  I am going […]

Maintaining the HTML cache clearer

The HTML cache clearer does exactly what its name implies: it clears the Sitecore HTML caches. More specifically, it clears Sitecore HTML caches upon observing a publish end event. More specifically still, it clears the HTML cache of all websites that are registered with the HTML cache clearer upon observing a publish end event. There are quite a few posts around about how performance of the HTML cache can be improved (*cough* John West *cough*), but one thing that people don’t seem to mention often is how annoying it is to maintain the configuration correctly. This post outlines the method that I prefer to use, and it works pretty well for me so hopefully someone else will find it useful too.

Conditional Placeholder Settings

I’ve always considered the rules engine to be a pretty cool part of Sitecore. In this post, I’ll talk about using the Sitecore rules engine in order to affect Sitecore placeholder settings in the page editor (or experience editor as it’s soon to be called). I’ve also put the code for this module (for want of a better word) as it stands in a GitHub repository.

Using multiple button roots on a Sitecore edit frame

Edit frames are a well-known part of the Sitecore page editor, they allow developers to show buttons around arbitrary parts of the page.  Edit frames will take a single button root and then display all the buttons in that folder on a toolbar.  From someone who uses edit frames quite a bit, I always used to find it quite annoying that I would have to duplicate buttons if I wanted to have the same button on different edit frame toolbars.  After a bit of digging, I found a way to extend edit frames that would allow me to specify multiple button roots on each toolbar, allowing me to re-use groups of buttons.

Allowing sublayouts to control their own HTML cache keys

I spoke to a fellow MVP recently, Kern Herskind Nightingale and the topic of my blog came up, along with the fact that I hadn’t (at the time) updated for a while. The reason was my previous post about overriding rendering types. Originally, I had intended to use an example that would allow developers to add an interface to their sublayout classes and specify custom logic around building their cache keys, but it didn’t work as I’d intended.

Sitecore Rendering Types

The topic of rendering types came up at the office the other day, and I wanted to write a quick post about them.  Rendering types are a group of classes that Sitecore uses to build up the controls on its pages using the presentation settings.  They handle the creation of the actual controls that Sitecore […]

Custom Sitecore Pipelines

Pipelines are a very useful feature in Sitecore, one that I make use of a great deal.  I see a great many Sitecore website solutions that create their own processors to add to the existing pipelines (or which override existing pipeline processors), but I very rarely see solutions that have created their own pipelines. Usually I only see it in modules.  I think that developers might be missing a trick, as there are a great many things that you can do with a simple pipeline and it provides easy extensibility throughout the project lifetime.

Dynamic Placeholders and IExpandable

There have been a few solutions for making placeholder keys dynamic, to allow for page structures that would traditionally result in placeholder keys becoming duplicated. However, nobody seems to have written about how this can naturally be expanded to allow for actual placeholders to be dynamically created based on the whims of the sublayout at the time (or at least, I couldn’t find any articles when I had a quick look). So, here’s how you do it.

NVelocity: Sitecore’s original template engine

NVelocity is a text templating engine that ships with Sitecore. Although the project itself doesn’t seem very active any more, I still find the tool to be useful on occasion. As such, I thought that I’d write a quick post to go over how you use this, and provide a couple of ideas in terms of how it can be used.

Unit Testing Sitecore

Unit testing is a very popular topic, and is a very good practice to adopt. Unfortunately, as anyone who has worked with it will know, some common Sitecore classes can’t be mocked or be directly instantiated. So, the logical solution is to let your unit tests access the Sitecore API and databases. This post contains some instructions on how I do this.