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

XF Page usergroup conditional

Discussion in 'XenForo Questions and Support' started by Morgain, Dec 7, 2011.

  1. Morgain

    Morgain Well-Known Member

    I have this type of code for an XF Page Title,

    Code:
    <xen:h1> {$visitor.username}'s Toybox</xen:h1>
    which displays as [MyName]'s Toybox if I'm logged in

    How do I add a conditional so if it's someone not logged in it reads
    [General Visitor]'s Toybox

    I knew how to do this on another forum ...
    and I HAVE searched the Manual, FAQ, general forum searches.
     
  2. James

    James Well-Known Member

    Code:
    <xen:h1> {xen:if '{$visitor.username}', '{$visitor.username}', 'General Visitor'}'s Toybox </xen:h1>
    Try that.
     
    Morgain likes this.
  3. Floris

    Floris Guest

    Not sure that will work
     
  4. Floris

    Floris Guest

    Yeah, looks like : {$visitor.user_id}
     
  5. Morgain

    Morgain Well-Known Member

    :) It works.
     
  6. James

    James Well-Known Member

    Woops, I meant to put $visitor.user_id but username should work too.
     
  7. Floris

    Floris Guest

    tried it in the footer template with username, didn't work, user_id did work.
     

Share This Page