DarkGizmo Well-known member Feb 9, 2021 #1 Is it possible to limit the visibility of a specific sidebar widget to only certain groups? If so, how can this be achieved?
Is it possible to limit the visibility of a specific sidebar widget to only certain groups? If so, how can this be achieved?
Ozzy47 Well-known member Feb 9, 2021 #2 Sure, use the “ Display condition” setting for the widget. $xf.visitor.isMemberOf(123) for single group, and $xf.visitor.isMemberOf([123, 124, 125]) for multiple groups. Upvote 1 Downvote
Sure, use the “ Display condition” setting for the widget. $xf.visitor.isMemberOf(123) for single group, and $xf.visitor.isMemberOf([123, 124, 125]) for multiple groups.
DarkGizmo Well-known member Feb 9, 2021 #3 so where the 123 is i put the group ID, correct? and this will work if they are a member of that group even as a secondary group? Upvote 0 Downvote
so where the 123 is i put the group ID, correct? and this will work if they are a member of that group even as a secondary group?
bryanb Active member Jun 9, 2021 #5 Quick question: what if I want all users to see the widget except for only one user group? How would I write that? Please let me know. Thanks! I have an old forum with about 50 user groups - I am trying to alleviate listing all of these numbers except for one. Upvote 0 Downvote
Quick question: what if I want all users to see the widget except for only one user group? How would I write that? Please let me know. Thanks! I have an old forum with about 50 user groups - I am trying to alleviate listing all of these numbers except for one.
K Kirby Well-known member Jun 9, 2021 #6 Just negate the condition: !$xf.visitor.isMemberOf(123) Upvote 0 Downvote
bryanb Active member Jun 10, 2021 #7 Kirby said: Just negate the condition: !$xf.visitor.isMemberOf(123) Click to expand... And how would one do that? I don't have a coder handy. Thanks! Upvote 0 Downvote
Kirby said: Just negate the condition: !$xf.visitor.isMemberOf(123) Click to expand... And how would one do that? I don't have a coder handy. Thanks!
K Kirby Well-known member Jun 10, 2021 #8 ? I've already posted how to negate the condition (by placing an ! at the beginning). Upvote 0 Downvote
bryanb Active member Jun 11, 2021 #9 Ok - thanks! Much appreciated. I didn't know how that was done. Upvote 0 Downvote