Main

Sitecore CDP & Personalize Templates

Description

Templates are an incredibly valuable resource for developers, providing them with a tool to create reusable code with ease through the platform. However, the benefits of templates extend beyond the realm of developers. Marketers and non-developer users can leverage these pre-designed templates to craft compelling web experiences, filter target audiences, and extract valuable data from decision models, all without the need for any coding expertise. By simplifying complex processes and streamlining workflows, templates enable users to achieve their goals with greater speed, efficiency, and accuracy, empowering them to unlock new levels of creativity and productivity.

There are some types of templates, but the most used are:

In order to make them more usable you can add as many inputs as you want to any template, so marketers can customize everything you enable them in code. In order to add input variables to any template you need to use a specific syntax:

[[ parameterName | type | value | { config1: value1, config2: value2 } ]]
All this line of code is going to be replaced by the variable that the user introduces. You don’t need to create another variable and assign it to this, you can use this code as the variable. At the same time, it will creat the UI for the user to introduce that variable.

The parameter name is the name of the field that is going to be shown to the marketer when the template is used. This is required.

The type is the type of variable that is going to be introduced. It can be string, text, number, enumerated, and colour. Each one of those is going to display a different type of UI input. This is required.

The value is the prepopulated value that is going to appear in the input when the template is used. This is NOT required.

Finally, all the configs are different configurations that you can add to the field, so you can add:

  • group: The name of the group of inputs (string)
  • orderGroup: The order in which those groups are going to appear in the UI (integer)
  • order: The order in which the inputs are going to appear (integer)
  • required: If the input is required or not (boolean)
  • max: In case the type of input is string or text you can put the character limit (integer)
  • values: In case the type of input is enumerable, you can add this config that is going to add a value to each of the options displayed to the user in the UI (list)

All the configurations are NOT required.

Finally, if you need to use the variable in different parts of the template you can just use it like this:

[[ parameterName ]]

Examples

Example With Predefined Values

Defined Variables

<!-- Variables without predefined values -->
[[String 1 | string | | { group: Without Predefined Values, order: 1, required: true }]]
[[Text 1 | text | | { group: Without Predefined Values, order: 2, required: false }]]
[[Number 1 | number | | { group: Without Predefined Values, order: 3, required: true }]]
[[Enumerated 1 | enum(Example 1, Example 2, Example 3, Example 4) | | { group: Without Predefined Values, order: 4, values: [e1, e2, e3, e4], required: false }]]
[[Color 1 | colour | | { group: Without Predefined Values, order: 5, required: true }]]

User UI

User UI without predefined values

Example Without Predefined Values

Defined Variables

<!-- Variables with predefined values -->
[[String 2 | string | string 2 value | { group: With Predefined Values, order: 1, required: true }]]
[[Text 2 | text | text 2 value | { group: With Predefined Values, order: 2, required: false }]]
[[Number 2 | number | 2 | { group: With Predefined Values, order: 3, required: true }]]
[[Enumerated 2 | enum(Example 1, Example 2, Example 3, Example 4) | e2 | { group: With Predefined Values, order: 4, values: [e1, e2, e3, e4], required: false }]]
[[Color 2 | colour | #ffffff | { group: With Predefined Values, order: 5, required: true }]]

User UI

User UI without predefined values

Powered by Paul Bonilla