Zeta Markup Language (ZML)

Zeta Markup Language (ZML) is based on the open-source template language Liquid created by Shopify. ZML is used in the Zeta Marketing Platform to perform personalization and dynamic operations within the content. ZML code can be categorized into objects, tags, and filters.
Objects
Objects tell ZML were to show content on a page. Objects and variable names are denoted by double curly braces: {{
and }}
. This is how user properties can be populated within the content to perform basic personalization.
Input
Output
|
In this example, ZML is rendering the content of an object containing the user property called first_name,
and that object contains the string, Ryan
.
Tags
Tags are used to define logic within the content. They are denoted by curly braces and percent signs: {%
and %}.
This markup used in tags usually does not produce any visible text. Possible exceptions are noted below. This means that you can assign variables and create conditions and loops without showing any of the ZML in content.
Input
Output
|
Tags can be categorized into several types. You can read more about each type of tag in their respective sections.
Filters
Filters change the output of a ZML object. They are used within an output and are separated by a |
.
Input
Assuming Output
|
Multiple filters can be used on one output. They are applied from left to right.
Input
Output
|
Points to Remember
Explicit Syntax in Global Assignment:
When using {% global displayed = "store" %}, the double quotes are explicitly part of the value being assigned to the variable a. Liquid interprets this as a literal string, including the quotes.
Unlike {% assign displayed = 'store' %}, which uses single quotes and strips them during rendering, the global assignment retains the double quotes because it treats them as part of the value.
This behavior is intentional to allow developers to assign values with specific formatting or characters that should be preserved.Rendering Behavior in Liquid:
Liquid's rendering engine outputs the value of a variable exactly as stored. For {% global displayed = "store" %}, the value stored in a includes the double quotes, so {{displayed}} renders "store.
In contrast, {% assign displayed = 'store' %} stores the value close without quotes, so {{displayed}} renders close.
This difference arises because global is designed for broader scope and explicit assignments, while assign is optimized for simpler, local assignments.Difference in Parsing Between Global and Assign:
The global tag is often used for defining variables that need to persist across multiple templates or scopes. It prioritizes preserving the exact value, including any formatting like double quotes.
The assign tag, on the other hand, is scoped locally and simplifies the assignment process by stripping unnecessary characters (like quotes) during rendering.
This distinction ensures that global can handle more complex or formatted values, while assign is better suited for straightforward assignments.