Documentation >> Conditionals >> users >> userGroupName
Conditional Macro: userGroupName
Operators:
- == (equal to)
- != (not equal to)
Usage Notes
- Tests to see if the user is a member of the specified group.
- The gruop is specified with the |conditional value|, to the right of the operator.
- In a web page, this macro will evaluate to true if the current user is a member of the specified group, and is logged in. Otherwise, it returns false.
- In email, this is how it works:
- If the site is in Single-Subscriber mode (using a mailing list), then it will always return false because the single email is being sent to all subscribers.
- If the site is in Multi-Subscriber mode, then it will behave exactly like it does when being used in a web page. That is, if the person receiving the message is a member of the specified group, it returns true. Otherwise, it returns false.
Examples
This example would show line 1 to members of the group "marketing", line 2 to members of the group "sales" who aren't also members of "marketing", and line 3 to everyone else.
<!--#if condition="userGroupName=='marketing'"-->
1. You are a member of the marketing group!
<!--#elseif condition="userGroupName=='sales'"-->
2. You a member of the sales group, and are not a member of the marketing group.
<!--#else-->
3. You're not a member of the marketing or sales groups.
<!--#endIf-->
See the above code in action, here:
3. You're not a member of the marketing or sales groups.
View in DG
|