Appearance
Conditional Content
This feature is available with the Plugin for Business plan and higher.
If you're on the Plugin for Startup or Plugin Expansion plan, consider upgrading to access this feature. For more details, visit our pricing page or contact support.
Conditional Content lets a single section carry several variants, each shown only when its condition matches. It covers audience personalization and A/B structures, and the variants are edited visually inside the editor rather than written as raw syntax.
More detail on the feature is available in our support article.
Enabling conditional content
Add the following option to TOPOL_OPTIONS:
ts
enableSectionVariants: true,This setting unlocks the UI for adding and managing conditional variants of sections directly inside the editor interface.
Adding and managing section variants
- Add structure variant

- Add condition for certain variant

- Switch between variants and edit its content

Conditions play very nice together with Merge Tag Previews.
Conditional syntax
The generated syntax is compatible with Mailchimp and SparkPost, selected through emailServiceProvider:
ts
emailServiceProvider: 'mailchimp' | 'sparkpost',We are eager to expand our compatibility with additional providers. If you have a specific provider in mind, please reach out to our support team with your request.
Comparators
Each condition combines a Merge Tag, a comparator and a value. Seven comparators are available:
| Comparator | Meaning |
|---|---|
is | Value matches exactly |
is not | Value does not match |
exist | The Merge Tag is present (hides the value field) |
> < >= <= | Numeric comparisons |
The four numeric comparators can be removed from the picker, leaving only is, is not and exist:
ts
disableExtendedComparators: true,Chaining conditions
Chaining connects several conditions on one variant with AND or OR. It is controlled by logicalOperatorsInsideVariant, and both providers support it:
ts
logicalOperatorsInsideVariant: true,
When the option is left unset, SparkPost turns chaining on and Mailchimp leaves it off. Setting it explicitly overrides that default in either direction.
Merge tag-specific autosuggestions
Autosuggestions offer known values for a Merge Tag while a condition is being written, which cuts down on typos. Define them by adding a suggestions array to the Merge Tag configuration, so each Merge Tag carries its own list:
ts
{
value: "*|COUNTRY|*",
text: "Country",
label: "Free Shipping Countries",
// available suggestions for this specific Merge Tag
suggestions: ['USA','Germany','France','Spain'],
},The dropdown opens once a Merge Tag is selected and the user starts typing in the value field, or clicks the caret icon inside it. Suggestions are a convenience rather than a constraint, so any other value can still be typed in.

For more information about Merge Tags, visit this documentation.
Language-based variants
When using multilingual templates, a variant can be limited to specific languages, which suits a section that belongs in one language but not the others.
With multilingual enabled and two or more languages on the template, a language merge tag is added to the variant condition autocomplete. Its default name is TOPOL_TEMPLATE_LANG.
To create a language-based variant:
- Add a variant to a section
- Type
TOPOL_TEMPLATE_LANGinto the condition field - Choose the language code from the suggested values (e.g.,
cs,en,de)
The suggested values come from the languages configured on the template. Selecting one also switches the editor to that language, so the variant is edited in context.
Custom language merge tag
The merge tag name is configurable via TOPOL_OPTIONS:
ts
languageMergeTag: 'MY_CUSTOM_LANG_TAG',If not set, the default value is TOPOL_TEMPLATE_LANG.
When sending emails, set the value of this merge tag to the recipient's language code to control which variant is displayed.
