• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.3 Secondary Group version of {$user.user_group_id}?

Staxed

Active member
#1
I'm trying to work on a template edit that is currently using {$user.user_group_id}, but that only works for primary usergroups. I would like for this to work for secondary groups as well...but can't seem to find the right thing to do it.
 

Brogan

XenForo moderator
Staff member
#2
Depending on what you are doing, you can use <xen:if is="{xen:helper ismemberof, $visitor, x}">

Use <xen:if is="{xen:helper ismemberof, $visitor, x, y}"> for more than one user group.
 

Staxed

Active member
#5
It may work if you replace $visitor with $user, if you are referring to the profile, rather than who is visiting it.
That worked, thanks. Was trying all sorts of things to replace $visitor with but never tried $user, are those options listed anywhere, I didn't see it mentioned in Brogans threads or in the documentation...I looked before I posted the question, did I miss it...or do you just have to "know"?
 

Brogan

XenForo moderator
Staff member
#6
It is stated in the resource.

Depending on the template being worked with, you may need to use $user instead of $visitor; $visitor is always the record for the current logged in user, $user is the record being processed (e.g. message author, member list, list of online users, etc.).