True Clarity at the MVP Summit

Here at True Clarity we are lucky enough to have three MVPs… all Sitecore nerds! As you can imagine the chance to visit New Orleans and be part of the MVP Summit was one we all jumped at when True Clarity offered to fund the trip. A massive thank you to the company.

Over 90 out of 167 recognised MVPs attended the event, which is a whole host of Sitecore love and brain power in one room! The impressive turnout really does show the enthusiasm all the MVPs have for the platform.

I had high hopes for the event especially after seeing the agenda for the two days. The welcome drinks, canapés and chance to network with the other MVPs the night before the summit was excellent, but the real business started on Tuesday. We were lucky enough to see Sitecore’s vision of the future and the road map for the next year or so first-hand. This really is one of the main reasons I wanted to become an MVP, to get involved and engrossed with the future direction of Sitecore in some capacity. I was not let down.

Day 1

The Tuesday sessions kicked off with an introduction by Pieter Brinkman, a video containing some captivating music and a swarm of numbers showing the appreciation Sitecore has for its MVPs, which as you can imagine got us all buzzing. Did you know that the MVPs, (a group of just 0.53% of the Sitecore certified community) contribute to over 50% of blog Posts, presentations and Sitecore modules?

The real “Strap in, hold on, because this is where the technology is going” ride started with a great talk by Todd Mitchell on xDB vNext and Brandon Hubbard who shared (top secret) plans for Speak 2.0 something, which I really feel is going to be huge when it hits the masses.

We also heard some (again top secret) insights into the next couple of Sitecore releases by Kern and Stephen Pope. Some really exciting features in the pipeline, both for developers and end users to get excited about.

I was exhausted after all that but quickly reminded we had a swamp to tour, alligators to feed, cigars to smoke and moonshine to drink – It’s safe to say Sitecore can put on a party!

Day 2

The “I attended breakfast” achievement badge (MVPs love achievements it seems) never had so much significance as it did the morning after the swamps. Everyone still turned up, not wanting to miss the final day of the summit.

The real highlight of the summit for me was on day two. Fan favourites Kern and Stephen Pope were back for a talk on the future of the core of the platform. Following the common theme of ‘top secret – please do not share anything’, I’m going to stay vague but I was blown away with the plans Sitecore (and in particular Stephen and Kern) had for the future of the platform. The amount of time afforded to listen and discuss the MVPs opinions was also fantastic – I think by the end everyone in the room was on the same page and thinking “Wow this is going to be great… but let me have it now!”

Other highlights included the opportunity for us MVPs to have round table discussions with Sitecore staff about specific requirements or wishes we had for the platform. I think we managed to convince Stephen to include about two hundred ‘essential’ features into the next release (he did have his fingers crossed) but it’s great to see the platform moving in the direction it is following feedback from the MVPs – feedback Sitecore obviously value.

Being a MVP newbie myself (first year as an MVP) the summit completely convinced me (not that I really needed to be) that Sitecore continue to move in the right direction. These are exciting times for a number of different areas within the platform. The benefits to developers, marketers, content editors, well… literally every Sitecore user has the potential to be huge, and it was amazing to see and be involved in these plans first hand.

Thank you Sitecore!

Dynamic Placeholder Keys in Sitecore

Sitecore have spent a long time designing a CMS which provides great flexibility for both developers and content editors. If you have designed your renderings and placeholders in an intelligent way a seemly complex page can become a playground for content editors. Despite Sitecore’s huge improvements throughout the years one fundamental problem however still seems to remain – or should I say, I have not yet found a good out of the box solution! Perhaps Sitecore themselves can prove me wrong.

Consider a simple page with a container rendering (5050Container.ascx for example) which splits the page in two:

<%@ Control Language="c#" AutoEventWireup="true"  %>
 <div>
 <sc:Placeholder ID="Placeholder1" runat="server" Key="halfleft" />
 </div>
 <div>
 <sc:Placeholder ID="Placeholder2" runat="server" Key="halfright" />
 </div>

We could put control’s into the left and right placeholders via the Page Editor or indeed via Layout Details.

Control A’s placeholder path would represent /main/halfleft.
Control B’s placeholder path would represent /main/halfright.

Now consider we would like to add a second row using the same container – We hit a problem when we try and add controls into the placeholders of this second container because the placeholder paths resolve to the first container.

One solution is to create a second container (e.g. 5050Container2.ascx) with different keys:

<%@ Control Language="c#" AutoEventWireup="true"  %>
 <div>
 <sc:Placeholder ID="Placeholder1" runat="server" Key="halfleft2" />
 </div>
 <div>
 <sc:Placeholder ID="Placeholder2" runat="server" Key="halfright2" />
 </div>

This is quite untidy, and if content editors want to add many rows where do you stop, Sitecore could become full of multiple versions of the same container rendering.

A better approach would involve just one rendering which we would want repeated, again for example our 5050Container.ascx. We would want to automatically suffix placeholder keys each time a repeating container is added to the page. For example, if we had two 5050Containers’s on the page the keys for the first container would dynamically be generated as halfleft1, halfright1 and then for the second container halfleft2, halfright2 and so on.

Before I started implementing this approach I had a quick browse on Google and came across a very good article by Nick (@techphoria414) http://www.techphoria414.com/Blog/2011/August/Dynamic_Placeholder_Keys_Prototype. Nick had a similar idea which I’ve used to implement my approach.

The concept is quite simple, create our own implementation of the sc:Placeholder control and let this decide whether the container should be repeated, if so change the key.

Containers need to be repeated if:

–          They sit in the same placeholder.
–          They are the same control.

I have pasted the code at the bottom of this post, but please bear in mind it is a prototype. Add the class to your solution and add its namespace/assembly to the <controls section of your web.config:

<add tagPrefix="tcuk" namespace="Tcuk.Cms" assembly="Tcuk.Cms" />

Then it’s the simple task of replacing your sc:placeholders on containers you want to repeat. i.e.:

<%@ Control Language="c#" AutoEventWireup="true"  %>
 <div>
 <tcuk:DynamicKeyPlaceholder ID="Placeholder1" runat="server" Key="halfleft" />
 </div>

You will notice in the page editor if you add multiple repeating containers the keys will be dynamically updated:

And this is reflected in the Layout Details:

Continue reading