2

Our client has asked that we make the header and footer of their Sitecore site (version 8.2) personalizable and A/B testable.

Usually I would create a 'settings' item in the content tree for the header/footer content but that wouldn't allow the required functionality.

How can I achieve the above without having to set a data source on every header/footer component in the site?

2
  • 1
    Even if I am using the dynamic renderings and create a test. I can only able to create a working A/B test per page/item basis. I did tried to create a test on the standard values but that didn't seem to work.
    – Methee
    Sep 20, 2018 at 19:36
  • I have not tested this in a while, but you can personalize composite components. So all the headers on your site are really one header. chrisvandesteeg.nl/2015/11/03/sitecore-composite-components
    – Chris Auer
    Sep 21, 2018 at 4:02

1 Answer 1

2

If you need to personalize or A/B test the Header and Footer (or any other global presentation detail, than they cannot be statically rendered to the page.

In other words you cannot do:

@Html.Sitecore().Rendering("{guid}")

You must apply a placeholder that applies the navigation or global elements to the page, so that they can be personalized. This is also known as Dynamic Renderings and is at the core of being able to use datasources and using different mechanisms to change the datasource based on conditions.

Typically that would also mean that now you would have to have this navigation applied to every page item of your site. There are a couple of options you have to help reduce the amount of effort that this would require.

You could define a Base Template that includes information about the placement in Presentation Details in the Standard Values, and then apply that template to all of your Templates that would need it. I'm not sure that would work too beautifully if this is a change you are making. That works better if it's a new build out.

Second option is that you could build something similar to SxA's feature Partial Designs that would basically be a way to define a grouping of presentation details and include that on a page. All modifications would happen on the grouping, and the pages would just inherit the changes you make to the grouping or partial design.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.