Reputation: 1554
I will preface that this may not be the best use of a branch template, but it seems ok on paper, with a few drawbacks.
Sitecore 8, we have a Template called "Program." Program needs the ability to either be a two-column (9-3 grid) or a full (12-col grid). These basically represent a full version and a version with a right rail.
We want the content editors to be able to decide when they create the page whether they want a "program" or "program with right rail." To set this up, we created two branch templates. One that looks like this:
Layout: Base Layout
Renderings: Full (sublayout), Program Detail (rendering, dropped onto Full's placeholder)
And one that looks like this:
Layout: Base Layout
Renderings: Two-Column (sublayout), Program Detail (rendering, dropped onto Two-Column's placeholder)
Placeholder settings: Right Rail (allows right rail components to be added)
Then when the user right clicks on the "programs" item in the tree, they can pick one of the two options above and it creates the program item with the appropriate presentation details (again, either a full width or a two-col).
This all works, but the problem is if I ever have to change something on one of the branch templates, that change is not propagated to any items that were created based off of that branch like standard values works. There's no "branch delta" that I'm aware of.
Is there a better way to handle this? In my head, it essentially sounds like I need standard values for a branch template, but I don't think that exists.
Another thought I had was to create an "Program Master" template and then create two templates that inherit from it, Program and Program with Rail. That way they would share the same data but would have different standard values and allow me to set different presentation details for it. This feels a little dirty since I'd basically be creating a template to handle look and feel. I hope I'm explaining this correctly, but if not I'll update with more info if I'm being unclear.
Upvotes: 1
Views: 393
Reputation: 6890
Unfortunately if you want to take advantage of "layout deltas," out of the box you would need to have a separate template with its own standard values, as far as I'm aware.
You could probably do something fancy with the renderLayout
pipeline if you wanted -- e.g. Sitecore Zen Garden introduces the concept of "Designs" which are used to define default layout, and allow you to separate layout from Standard Values. But you're going off the reservation at that point.
Upvotes: 3