Documentation >> Conditionals >> Messages >> msg.label >> msg.label.position
Message Conditional Macro: msg.label.position
Operators:
- == (equal to)
- != (not equal to)
- greaterThan
- greaterThanOrEqualTo
- lessThan
- lessThanOrEqualTo
Usage Notes
- This conditional tests the 'position' property of the label assigned to the current message, comparing it with the |conditional value| on the right side of the |conditional operator|.
- The position of a label is a number assigned to each label, which determines the order they are sorted. Label positions start at 0 (zero), which is the always the position of the item for "No Label Assigned" (usually referred to simply as '[None]'). The other positions continue with 1, 2, 3, and so on for as many labels as have been created in the conversation.
- Positions are guaranteed to be unique (no two labels can hold the same spot in the list), but they can be changed.
- If a message has not been given a label, the label's position is zero.
Examples
In this example, the first line will be shown if the message has not been labelled, the second if the message has been labelled with any label from 1 to 5, and the third line for all others. The "documentation" label has a position of 8, so in the working example (at the bottom), you'll see line 3.
<!--#if condition="msg.label.position == '0'"-->
1. This message has not been given a label.
<!--#elseif condition="(msg.label.position >= '1') && (msg.label.position <= '5')"-->
2. This message is labelled with one of the first, second, third, fourth, or fifth labels.
<!--#else-->
3. This message has been given a label whose position is higher than 5.
<!--#endIf-->
See the above code in action, here:
3. This message has been given a label whose position is higher than 5.
View in DG
|