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
Jean Carlo Member Jun 13, 2023 #10 I have a question, I have a widget that for some reason is only shown to registered users. Is there any code to show it to all users? Upvote 0 Downvote
I have a question, I have a widget that for some reason is only shown to registered users. Is there any code to show it to all users?
P Paul B XenForo moderator Staff member Jun 13, 2023 #11 Unless you specifically chose not to, or permissions are involved, widgets are automatically shown to all visitors. Upvote 0 Downvote
Unless you specifically chose not to, or permissions are involved, widgets are automatically shown to all visitors.
Jean Carlo Member Jun 13, 2023 #12 Yes, I solved it, the widget involved the attached files as images. Now I enabled the attachments so that all users can see them and it worked Upvote 0 Downvote
Yes, I solved it, the widget involved the attached files as images. Now I enabled the attachments so that all users can see them and it worked