7

I am using the Sitecore 8.2

I have a template T1 which has rendering R1 set on its Standard Values (set a long time ago, maybe at the age of Sitecore 7 or earlier).

There is a set of templates T2, T3, etc. which inherit presentation details from the T1 standard values + each of them has some additional renderings assigned to their Standard Values.

I noticed that if I update a placeholder name of R1 on the T1 standard values, it is not populated to the rest of the inherited templates.

Is that an expected behavior?

What would be your suggestion on updating all of the template's placeholders for R1?

  • If such changes happens rarely, you could use SPE (Sitecore Powershell Extentions) to script the change to all your templates standard values item. – Jean-François L'Heureux Aug 4 '17 at 11:29
6

By default, Sitecore doesn't support rendering inheritance for templates standard value items.

When you created T2 and T3 standard values items, the __Rendering and __Final Rendering field values were copied from T1, not inherited. That's why modifying the rendering of T1 standard values doesn't affect T2 and T3 standard values rendering.

There are a couple of blog posts with workarounds to get the desired behavior using layout deltas (also called patches). Here's one of them: https://www.cognifide.com/our-blogs/sitecore/complex-layouts-in-sitecore-using-standard-values-hierarchy/

The idea is to attach to the item saved event, monitor standard values items changes, and modify what is about to be saved for the __Rendering and __Final Rendering field values. The original value would be a copy of the base template field plus the changes that were done. You have to calculate the delta between this value and the base template field value. Then store this delta in the field instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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