Dynamic Placeholder Keys in Sitecore

One of my colleagues at True Clarity has come up with a really neat solution to one of the challenges introduced by the Sitecore Rendering Engine. If you want to have the same container sublayout multiple times, its difficult to achieve since the placeholder’s xpath will be the same for each row.  The solution was to setup dynamic placeholder keys which allow for similar containers to be repeated in a page’s layouts.

The setup this then allows for is:

Placeholder main
– Container in main with placeholders left and right
— Widget in container left / Widget in container right
– Another container in main with placeholder small
— Widgets in container small
– Container in main with placeholders left and right
— Widget in container left / Widget in container right

Without the updated placeholder keys, you would never get the last row of widgets since the xpath for each row would evaluate to the same value (/main/left and /main/right for each row)

You can read all about it at http://trueclarity.wordpress.com/2012/06/19/dynamic-placeholder-keys-in-sitecore/

2 thoughts on “Dynamic Placeholder Keys in Sitecore

  1. I am trying to create a popup window that will allow you to select an item from a list of items in a folder. This event should happen when you click on a menu similar to the insert from template, How do I go about doing that?

Leave a Reply

Your email address will not be published.