Sitecore shared placeholders

Having recently attended SUGCON Europe 2016 in Copenhagen, I arrived back in Bournemouth buzzing with different ideas that we could make use of at Redweb.

One of my favourite talks was Atomic Design To The Max by Tim Braga. Tim talked about the journey his team had taken at Collette to implement Atomic Design.

They faced a challenge while implementing Atomic Design for their new header and footer. The problem with Sitecore, is that normally you statically bind the header and footer to a placeholder to avoid content editors having to set it on individual pages. The downside is you lose some of Sitecore's nice features such as A/B testing and personalisation. It also means you can't make use of Dynamic Placeholders that Atomic Design is heavily reliant on (hopefully one day Sitecore will add Dynamic Placeholders into the core product).

Tim has come up with a solution for Sitecore 7 that allows content editors to set header and footer renderings on a Home item which is then shared across all other items.

When implementing this on a Sitecore 8 solution, I ran into issues where the code didn't behave as expected, so I've had to tweak the code to get it working. I've taken the opportunity to enhance it slightly, you can now control the placeholder names and Home Item ID within configuration. I have also removed the need for the JS changes by adding another Sitecore pipeline - RemoveSharedRenderings.

Author image
About Tom Dudfield
Bournemouth
I'm a Development Director currently working at Redweb in Bournemouth where I architect Sitecore solutions.