DarkGizmo Well-known member May 29, 2021 #1 Is it possible to show a specific navigation tab only for a specific usergroup or groups? Example: A "Partners" tab only displayed for the Partners usergroup and staff? Is this possible to achieve? If so, how is it done?
Is it possible to show a specific navigation tab only for a specific usergroup or groups? Example: A "Partners" tab only displayed for the Partners usergroup and staff? Is this possible to achieve? If so, how is it done?
P Paul B XenForo moderator Staff member May 29, 2021 #2 Use $xf.visitor.isMemberOf(x). Replace x with the user group ID. Upvote 0 Downvote
DarkGizmo Well-known member May 29, 2021 #3 Do i need to edit a template to achieve this @Brogan ? Upvote 0 Downvote
P Paul B XenForo moderator Staff member May 29, 2021 #4 You enter it in this field for the navigation tab - /admin.php?navigation/. Upvote 0 Downvote
DarkGizmo Well-known member May 29, 2021 #5 And to check for multiple groups, it'd look like this? Code: $xf.visitor.isMemberOf(3,9) Or? Upvote 0 Downvote
P Paul B XenForo moderator Staff member May 29, 2021 #6 HTML: $xf.visitor.isMemberOf([x, y]) Upvote 0 Downvote
MapleOne Well-known member Feb 14, 2023 #8 Is there a way to show a navigation link to only a single member? ie: I am the admin and I want to make a custom menu only for me to see but it is also not intended for other admins. So I don't want to specify a User group but a single member. I tried: $xf.visitor.isMember(x) Upvote 0 Downvote
Is there a way to show a navigation link to only a single member? ie: I am the admin and I want to make a custom menu only for me to see but it is also not intended for other admins. So I don't want to specify a User group but a single member. I tried: $xf.visitor.isMember(x)
P Paul B XenForo moderator Staff member Feb 14, 2023 #9 That's for user groups. Use $xf.visitor.user_id == 1 . Change the ID to match your account. Upvote 0 Downvote
Awani Member May 7, 2023 #11 Where do I find usergroup ID? I want the specific tab to only be visible to those NOT logged in. That is usergroup "guest" I assume? Upvote 0 Downvote
Where do I find usergroup ID? I want the specific tab to only be visible to those NOT logged in. That is usergroup "guest" I assume?
P Paul B XenForo moderator Staff member May 7, 2023 #12 For guests use !$xf.visitor.user_id . Upvote 0 Downvote
Luca_ Active member Sep 22, 2024 #14 Paul B said: HTML: $xf.visitor.isMemberOf([x, y]) Click to expand... thx man; I love you Upvote 0 Downvote
Luca_ Active member Sep 22, 2024 #15 Paul B said: For guests use !$xf.visitor.user_id . Click to expand... and to hide it only from a user group? Upvote 0 Downvote
Paul B said: For guests use !$xf.visitor.user_id . Click to expand... and to hide it only from a user group?