Through the Giotto language, it is possible to add visibility conditions to the code.
Objects associated with these conditions will only be displayed if the condition is met.
Unlike Visibility Conditions added via the user interface, those added by code will not be editable by users.
Conditions can be combined using logical operators such as and, or, not, eq, neq, and contains.
Option | Description | Example |
mn:if | Applies a simple visibility condition. | <div mn:if="contact.values.GENDER eq 'M'">Special offer reserved for men</div> |
mn:elseif | Displays an alternative content if the first if is not met. | <div mn:if="contact.values.GENDER eq 'M'"> Special offer reserved for men</div> <div mn:elseif="contact.values.GENDER eq 'F'"> Special offer reserved for women</div> |
mn:else | Displays an alternative content if neither if nor elseif are met. | <div mn:if="contact.values.GENDER eq 'M'"> Special offer reserved for men</div> <div mn:elseif="contact.values.GENDER eq 'F'"> Special offer reserved for women</div> <div mn:else>You did not specify your gender<div> |
mn:userif | Enables the ability for users to input visibility conditions. If completed, the entered value will be the default shown to users. | <div mn:userif="contact.values.GENDER eq 'M'">The user can modify this condition which by default is M</div> |
mn:showif | Conditions the visibility of a parameter. | <meta mn:param mn:type="boolean" mn:name="option" mn:label="Show a text" /> <meta mn:param mn:type="text" mn:name="text" mn:showif="param.option eq 'true'" mn:label="Text" /> <span mn:if="param.option">[param:text]</span> |