Conditional text
The Conditions component enables you to wrap text in a set of conditions that determine when it should be displayed. Conditions can be any combination of languages or user-defined conditions. The text can be displayed if one or more conditions are met (OR) or only if all conditions are met (AND). You can also specify fallback text to display if no conditions are met.
Create categories and conditions
- In the CMS, click the Conditions collection.
- Click the Add icon to add a new Category
- Give it a Name and Description.
- For each Condition you want to add:
- Click the Add icon.
- Name the Condition and give it a Description.
- Toggle the Active status of the condition as required.
Add conditions to a topic
Conditions are set at the topic level. The language is determined by the page language. Other conditions are defined as an array in the metadata at the start of the topic.
- Create or edit a topic.
- In the Conditions area, expand the Categories and select the box of any Conditions you want to apply to the topic.
Add conditional text
- Select Conditional Text from the Embed list.
- Edit the component.
- Enter the Text Content.
- Add any Required Conditions.
- Add any Required Languages.
- Set the Condition Logic.
- Set the Language Logic.
- Select if both conditions and languages are required.
- (Optional) Enter the Fallback Text.