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

XF 1.3 Existing variable ?

LordsKing

Active member
#1
Hello

Is this variable exist ? : {$user.group_id}

Because i want to add the color of the member's group !

Example :
if the user has the user group id 3 :
<span class="style{$user.group_id}"> text</span>

SO it will be :
<span class="style3"> text </span>

Thanks
 

Brogan

XenForo moderator
Staff member
#4
I haven't actually tried it with that but you can use an if statement inline in CSS classes.
Otherwise you can use it in a standard if/else.
 

Brogan

XenForo moderator
Staff member
#6
For example:
Code:
<div class="{xen:if "{$param}", 'thisClass', 'thatClass'} anotherClass">Content</div>