mbr_select
Usage
This shortcode returns a value from a specified list, based upon a switch variable, similar to a programming switch construct.
Note
If a number n (integer) is used as the switch variable, the n-th ordinal value will be returned, if there is one.
If a string (alphanumeric) is used as the switch variable, the ordinal number of the matching value is returned e.g. if the third item matches, a 3 is returned.
Parameters
Parameters | Description |
---|---|
case | A list of values, separated by | (pipe). The first item in the list is the switch variable to be compared against the remaining values. Default: none. Required: yes. |
Validity
This shortcode is evaluated for any type of visitor.
Conditional Branching
This shortcode does NOT support conditional branching with [ELSE_select].
Nesting
Shortcode nesting within is NOT supported.
Examples
- Example 1
- Example 2
Returns no.
[mbr_select case='2|yes|no|maybe']
Returns 3.
case='maybe|yes|no|maybe'
API
Note
There is no ActiveMember360 API function equivalent for this shortcode. Please use the PHP function switch.