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

XF 1.1 Show Different code dependent on gender

Discussion in 'XenForo Questions and Support' started by akia, Feb 8, 2012.

  1. akia

    akia Well-Known Member

    Hi,

    I want to show different code in my template dependent on whether someone is signed in and what their gender is.

    The code I've got is as follows:
    Code:
    <xen:if is="!{$visitor.user_id}">
    Code for guests/nonspecified gender
    </xen:if>
    <xen:if is="{$visitor.user_id}">
    <xen:if is="{$user.gender} == 'male'">
    Code for Men
    </xen:if>
    <xen:if is="{$user.gender} == 'female'">
    Code for Women
    </xen:if>
    <xen:if is="!{$visitor.gender} OR {$visitor.gender} == ''">
    Repete of Code for guests/nonspecified gender
    </xen:if>
    </xen:if>
    But it dosn't work, can anyone tell me where I'm going wrong?
     
  2. ragtek

    ragtek Guest

    you're usign $user

    shouldn't it be $visitor? ;)
     
  3. akia

    akia Well-Known Member

    Ahh thank you, thats done the trick.
     

Share This Page