Thursday, December 23, 2010

Persona Changer update - testing any personalization rules in a few clicks!

Some time ago, we've got amazing Shared Source module called “Persona Changer” from Steve Green. Testing personalized websites became much easier in a very user-friendly way.

The only thing that left uncovered by the module was GeoIP and visit-related stuff. How would you test the following rules before?

In order to make it easier, I’ve updated “Persona Changer” recently. Now it is possible to define rules that will be active for selected persona. And it will work for all kinds of personalization rules, even your custom ones. I tried to keep it simple, so only add 2 additional fields were added to the “Persona” template:

Active Rules” field defines rules that will be always active for current persona.
Disable Other Rules” field allows you to turn off processing rules by Sitecore, in order to avoid possible collisions (it’s unlikely that they will occur).
After update, module will substitute “InsertRenderings” processor to execute custom rules (it is only active in Preview mode and when persona is selected).
if (!Context.PageMode.IsPreview || ID.IsNullOrEmpty(PersonaHelper.ActivePersona))
No changes to the web.config are required, PersonaChanger.config in “Include” folder will patch it:
<processor type="Sitecore.Pipelines.RenderLayout.InsertRenderings, Sitecore.Kernel">
    <patch:attribute name="type">ChangePersona.CustomInsertRenderings, ChangePersona</patch:attribute>
And you can setup and then test any personalization stuff in a usual way, using persona's:

You can download the module here, just install the package and enjoy the result. Module source code and documentation will be updated a bit later.

Happy Holidays!

1 comment:

  1. Hi Alex,

    Fantastic work! I actually wanted to do this but couldn't see a way to force rules to evaluate to true. Looks like you've taken a different route via InsertRenderings, very clever ;)

    - Steve Green