Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Blog - When Personalisation Breaks Rendering Parameters - Code
<?xml version="1.0"?>
<configuration xmlns:patch="" xmlns:set="">
<processor type="Sitecore.Mvc.Analytics.Pipelines.Response.CustomizeRendering.Personalize, Sitecore.Mvc.Analytics"
set:type="MyNamespace.ResetParametersOnSubstitutedRenderings, MyAssembly" />
public class ResetParametersOnSubstitutedRenderings : Personalize
protected override void ApplyChanges(Rendering rendering, RenderingReference reference)
// If the rendering being applied is different from the original renderings
if (!rendering.RenderingItem.ID.Equals(reference.RenderingItem.ID))
// Fetch the default rendering parameters for the new rendering
rendering.Parameters = new RenderingParameters(reference.RenderingItem.Parameters);
// Continue to apply the built-in changes
base.ApplyChanges(rendering, reference);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment