I'm looking for a working Dynamic Placeholder solution in MVC. There are at least two good descriptions of this "pattern" for use with WebForms:
- http://trueclarity.wordpress.com/2012/06/19/dynamic-placeholder-keys-in-sitecore/
- http://www.techphoria414.com/Blog/2011/August/Dynamic_Placeholder_Keys_Prototype
And I also found this blog explaining how to do it with MVC:
First I have tried to implement Techphoria's method (with GUIDs) using techniques from the MVC blogpost (extension of the SitecoreHelper) and I also tried implementing the last described method (uses number suffixes that are incremented Column_1, Column_2, etc).
With all the variations I tried I didn't succeed in creating a working solution. My placeholders don't get properly named (I ended up with strange placeholder structures, or placeholders repeating themselves).
Without going into the specifics of my attempts, I would like to know if anyone else has a working solution ready that I could use.
If I can't find an already working solution, I will describe my problem in more detail and see if I can get that to work.
I downloaded the Integrated Dynamic Placeholders package from the sitecore marketplace. When building your page it increments the placeholders with configurable suffix appended to the end of the placeholder key to make them unique, according to their order on the presentation layer. Worked out of the box for me.
I created this extension that creates dynamic placholders
It creates a placeholder with the guid in the name. I also created a step in the pipeline that extracts the guid, and checks for placeholder settings.
Code to get placeholder settings to the dynamic placeholder If you create a dynamic placeholder with @Html.Sitecore().DynamicPlaceholder("test") - the following code takes the setting from the placeholder settings named test
The following code removes the guid from the chrome data in the pageeditor
Edit
The web.config include settings are included below: