Page History
...
This page of the tutorial shows you how to configure these fields for a cookie named visits. Please read Cookies trait configuration before you begin.
Table of Contents |
---|
Info |
---|
You can import the XML files provided in the Download configuration files section if you prefer not to configure manually. |
Configuring the rule field
The rule field defines values for the trait when you choose an audience. The input entered into the rule field(s) is used to construct a voter. The voter decides if the visitor or visit matches the rule. When the rule is met, Magnolia delivers personalized content.
...
Adding the switchable field option
Options in the switchable field display in the Choose audience dialog when the user selects Visits in the Cookie field.
...
The configuration should look like this:
...
heading | 0 |
---|---|
multiple | false |
enableHeadingAttributes | false |
enableSorting | false |
class | m5-configuration-tree |
enableHighlighting | false |
...
Mgnl n |
---|
...
Mgnl n |
---|
...
Mgnl n |
---|
...
Mgnl n |
---|
...
Mgnl p |
---|
...
Visits
...
Mgnl p |
---|
...
visits
...
Mgnl n |
---|
...
Mgnl n |
---|
Adding the select field options
...
To add the visits
options, in /modules/personalization-traits/traits/cookies/ruleField/fields
:
- Add a
visits/options
node structure. - In the
/options
node:- Add one content node for each option. Our options are
one
,two
,three
,four
andany
. These are the internal names of the options. - Add two properties to each option node:
label
=<Option label>
: The label displayed in the field.value
=<Option value>
: The option value stored in the repository.
- Add one content node for each option. Our options are
- Optionally, add a
sortOptions
property to/visits
node and set the value tofalse
. This ensures that the options render in configuration order and not alphabetically.
The configuration should look like this:
...
heading | 0 |
---|---|
multiple | false |
enableHeadingAttributes | false |
enableSorting | false |
class | m5-configuration-tree |
enableHighlighting | false |
...
Mgnl n |
---|
...
Mgnl n |
---|
...
Mgnl n |
---|
...
Mgnl n |
---|
...
Mgnl n |
---|
...
Mgnl n |
---|
...
Mgnl n |
---|
...
Mgnl p |
---|
...
Mgnl p |
---|
...
Mgnl n |
---|
...
Mgnl p |
---|
...
Mgnl p |
---|
...
Mgnl n |
---|
...
Mgnl p |
---|
...
Mgnl p |
---|
...
Mgnl n |
---|
...
Mgnl p |
---|
...
Mgnl p |
---|
...
...
Mgnl n |
---|
...
Mgnl p |
---|
...
Mgnl p |
---|
...
Mgnl p |
---|
...
info.magnolia.ui.form.field.definition.SelectFieldDefinition
...
Mgnl p |
---|
...
any
...
Mgnl p |
---|
...
false
...
Mgnl n |
---|
...
Mgnl n |
---|
...
Mgnl p |
---|
...
info.magnolia.ui.form.field.definition.SwitchableFieldDefinition
...
Mgnl p |
---|
...
info.magnolia.personalization.cookie.CookieFieldTransformer
Configuring the value field
The value field defines the options that display in the Preview app. The field is used to preview variants when testing personalized content delivery.
...
The value field is an Option group field. The The option values should match the option configurations in the rule field.
...
The configuration should look like this:
...
heading | 0 |
---|---|
multiple | false |
enableHeadingAttributes | false |
enableSorting | false |
class | m5-configuration-tree |
enableHighlighting | false |
...
Mgnl n |
---|
...
Mgnl n |
---|
...
Mgnl n |
---|
...
Mgnl n |
---|
...
Mgnl n |
---|
...
Mgnl p |
---|
...
Visits: One
...
Mgnl p |
---|
...
visits=1
...
Mgnl n |
---|
...
Mgnl p |
---|
...
Visits: Two
...
Mgnl p |
---|
...
visits=2
...
Mgnl n |
---|
...
Mgnl p |
---|
...
Visits: Three
...
Mgnl p |
---|
...
visits=3
...
Mgnl n |
---|
...
Mgnl p |
---|
...
Visits: Four
...
Mgnl p |
---|
...
visits=4
...
Mgnl n |
---|
...
Mgnl p |
---|
...
Visits: Any
...
Mgnl p |
---|
...
visits=any
...
Mgnl n |
---|
...
Mgnl n |
---|
...
Mgnl p |
---|
...
info.magnolia.ui.form.field.definition.OptionGroupFieldDefinition
...
Mgnl p |
---|
...
true
...
Mgnl p |
---|
...
Download configuration files
...