Dusty Eves


Sitecore Architect with Paragon Consulting

Marketing Stencils – Custom Visitor Experience

In our last section we looked at implementation created pages with an eye towards presenting differently to our different audiences but this doesn’t offer much help with creating new content.  Here we’re going to look at new content stencils wherein we’re presenting a different experience to different visitors.

Example Use Case

Looking at our example from the Virtual Summit we can use a product page as an example.  Below we have a product page with a cross-sell sidebar, a perfect candidate for audience based personalization.

And here we have our author experience.  Our sidebar is personalized out at creation, and we’ve a distinct editor pane for each of our defined segments enabling the content author to present all aspects of our digital experience with no need to understanding the underlying digital strategy.

Technical How-To

Setting up implementation content is relatively straight-forward but creating authoring components to do the same is a little tricky.  The first thing that we need is the ability to create stencils from branch templates.  If you’re not familiar a stencil is a branch template that comprises a multi-part page.  If we go in Sitecore to our Branch templates section we find our Coffee Product stencil is has some similarities to how we have the personalization setup on our Shop page.

Setting up the stencil is pretty straight forward but we’ve an additional piece that we need in order to resolve these properly.  As is, creating a new instance of the Coffee Product stencil will result in our Also Like components having data sources that resolve to /sitecore/templates/branches/…

For these to resolve correctly we need to a processor in the addFromTemplate pipeline to resolve it correctly.  Kamsar has a module that does just that on GitHub called “BranchPresets”.  Kudos to him on the original authorship of the module, but it falls just short of what we need.  In addition to rewriting data sources beneath the branch we need to rewrite data sources found in rendering rules.  To that end I’ve a fork of his module here that answers that question: http://github.com/DustyEves/BranchPresets