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

XF 1.3 If Conditional to display code to guests and members of usergroup X

Discussion in 'Styling and Customization Questions' started by Ludachris, Jul 15, 2014.

  1. Ludachris

    Ludachris Well-Known Member

    Can someone post the correct conditional code to check if the person browsing is a guest OR is part of usergroup 23? I don't think what I have is correct.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. Ludachris

    Ludachris Well-Known Member

    So this should work:
    Code:
    <xen:if is="{$visitor.user_id} OR {xen:helper ismemberof, $visitor, x}">
    And to make sure a member is not part of several usergroups, I'd have to do this:

    Code:
    <xen:if is="!{xen:helper ismemberof, $visitor, 23} AND !{xen:helper ismemberof, $visitor, 24} AND...>
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    <xen:if is="!{$visitor.user_id} OR {xen:helper ismemberof, $visitor, 23">
     
  5. Ludachris

    Ludachris Well-Known Member

    Is there a way to check if a member belongs to ONLY a specific usergroup and no others?
     

Share This Page