XF 2.1 Widget Display Conditions

Jonathan Long

Active member
Adding a couple widgets, and I need to have them display for certain situations/users.

The first one I want to display only to visitors. Got that one handled using this:

Code:
!$xf.visitor.user_id

Now, the second one I need to display only if someone IS a member of one specific user group AND NOT a member of another specific user group.

Banging my head against the wall and it is probably such a simple solution...any suggestions would be greatly appreciated.
 
Nope, the ! before the second one it is "not".

So in English the entire expression is "Visitor is member of 123 AND NOT member of 456".

Note: I made a typo in my previous message which I have just fixed.
 
Thanks to Chris and others!

Those ! operators are some tricky things... :unsure:

My task was to ensure that a certain menu navigation button was not visible to any other but two select user groups. Using this expression form accomplishes that:

Code:
$xf.visitor.isMemberOf(2) OR $xf.visitor.isMemberOf(5)
 
Back
Top Bottom