Persona

Last Updated: 18 May 2017

The Persona asset is used for storing a customised set of keyword evaluation rules that together either evaluate the Persona as True or False.

When a Persona has been created and configured, it can we be used with Content Variations on Standard Pages for conditionally displaying different versions of a page depending on the evaluation of the Persona.

A Persona can also be set to evaluate client-side only when in use with a Variation. This means a frontend developer can write custom JavaScript based conditions client-side and then trigger the contents of a Variation to show or hide by targeting a custom variable saved against the Persona attached to the Variation.

Bookmarks

Details Screen

Details

  • Name: The name of the Persona will be reflected in the Asset Map as any other asset. However, it will also be used in the drop-down list of available Personas to apply to a Variation. The order of the Personas in this list are ordered alphabetically by their name.
  • Allowed Root Nodes: Select what areas of your system that are allowed to select this Persona for a Variation on a Standard Page. Only Standard Pages that are located under these Root Nodes will have this Persona available in their Variation Persona list.
  • Force No Cache: If this is set to Yes, any page that uses this Persona for evaluating if a Variation should be active or not, will be served with a Cache-control: no-cache header, regardless of what cache configuration settings are in place in the Cache Manager for the page.

Evaluation Settings

This section lets you configure the evaluation rules for the Persona. The Persona can be server-side based, client-side based, or both.

Server Side Evaluation Settings

  • Enabled: Enable this option in order to make the Persona server-side based.
  • Group Logic: Choose what logic to evaluate each group with in order to decide whether or not the Persona is true or false. You can specify that all groups must be matched or only one.
  • Group: Enter the keyword matches for this group. You can enter multiple keyword matches within a single group. The select field lets you decide what logic to use for the group to be considered matched.

Client Side Evaluation Settings

Enable this setting to make the Persona dependent on client-side JavaScript evaluation code.

If enabled, and this Persona is applied to a Variation on a Standard Page, the content of the Variation will be printed within a <template> tag. You can then write some frontend JavaScript that decides whether to show or hide this content.

  • Enabled: Enable this option in order to make the Persona client-side based.
  • Unique Variable: Use this field to enter a unique variable for the Persona that you can then use in your client-side JavaScript implementation to target the Variation content with. This variable will be printed as an attribute on the <template> tag that wraps the Variation content. For example:
    <template data-client-variation_id="{unique variable}">
      //variation content... 
    </template> 

This section only applies when you are using the Persona for a Variation. It has no affect when used with the Globals Persona keywords.

Using Both Server-Side and Client-Side Evaluations

You can enable both server-side and client-side evaluations on a Persona when using it for Variations. When doing so, Matrix will first evaluate the server-side conditions. If these are evaluated as true, the client-side functionality will kick in and still print the contents of the Variation within the template tag.

If the server-side evaluation is false, the template tag Variation content will never be printed as the server-side conditions take priority over the client-side ones.

Usage Screen

The Usage Screen tells you which Standard Pages have Content Variations that are dependent on this Persona.

This is useful to know if you want to archive the Persona and want to make sure that no live pages are currently using it.

This will not tell you which assets are using the Persona via Globals Persona keywords.

Global Persona Keywords

You can use global keywords to access a Persona directly and return its server-side evaluation, which will either be 1 (true) or 0 (false).

Read more about how to use the global Persona keywords on the Globals Keywords page.


Previous Chapter Next Chapter