1. 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 ?

Discussion in 'XenForo Questions and Support' started by LordsKing, Jun 21, 2014.

  1. LordsKing

    LordsKing Active Member

    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
     
    Adam Howard likes this.
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. LordsKing

    LordsKing Active Member

    Adam Howard likes this.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    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.
     
  5. LordsKing

    LordsKing Active Member

    Ok I will try to do that with many ideas :)
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    For example:
    Code:
    <div class="{xen:if "{$param}", 'thisClass', 'thatClass'} anotherClass">Content</div>
     
  7. LordsKing

    LordsKing Active Member

    There is a lot of user groups :/
     

Share This Page