aesir
New Member
Posts: 8
inherit
226828
0
Jul 31, 2024 21:54:15 GMT -8
aesir
8
November 2015
aesir
|
Post by aesir on Apr 16, 2023 18:02:33 GMT -8
I am attempting to show a navigation sidebar within the forum wrapper only if the current user is a member and not part of a particular group (in this case, the "Inactive" group).
I was using something like this:
{if !$[current_user.is_member] && ![current_user.group_15]}
<!-- side bar code here -->
{/if}
It doesn't seem to be working. Any help would be great. Also, I'm not totally sure that 15 is the right group id number, but that is what is displayed in the address for that particular group.
Any help would be appreciated!
|
|
Kami
Forum Cat
Posts: 40,198
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,198
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Apr 16, 2023 18:55:34 GMT -8
if this is what the syntax you used was exactly, you were so close. you're missing a $ in front of the group variable. (if the 15 is what shows when you look at the group URL that's correct btw).
if that's not the exact syntax you used, just copy/paste it in the next post you make here.
|
|
aesir
New Member
Posts: 8
inherit
226828
0
Jul 31, 2024 21:54:15 GMT -8
aesir
8
November 2015
aesir
|
Post by aesir on Apr 16, 2023 19:56:05 GMT -8
{if $[current_user.is_member] && !$[current_user.group_15]} That is the exact syntax, now corrected with the $ fixed. However, accounts assigned to that group can still see the navigation sidebar.
Edit:
I think I figured it out. This seems to be working:
{if $[current_user.is_member] && $[current_user.group.id] != 15}
|
|
Kami
Forum Cat
Posts: 40,198
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,198
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Apr 16, 2023 22:02:22 GMT -8
{if $[current_user.is_member] && !$[current_user.group_15]} That is the exact syntax, now corrected with the $ fixed. However, accounts assigned to that group can still see the navigation sidebar.
Edit:
I think I figured it out. This seems to be working:
{if $[current_user.is_member] && $[current_user.group.id] != 15} oh good catch, this is what i get for replying on mobile 🤪
|
|