1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[1.0.0 b1] Member / Guest Template Condition

Discussion in 'Tips and Guides [Archive]' started by Jake Bunce, Oct 7, 2010.

  1. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Here is some template code you can use to conditionally display something for members / guests:

    <xen:if is="{$visitor.user_id}">
    <xen:else />
    I tested this in several templates and it appears to work everywhere.
    danswano, Eagle, Jeffin and 12 others like this.
  2. yoghurtfarmer

    yoghurtfarmer Well-Known Member

    You can also use this for items that only appear to guests (advertisements, welcome messages, etc).

    <xen:if is="!{$visitor.user_id}">... </xen:if>
  3. BamaStangGuy

    BamaStangGuy Well-Known Member

    What about usergroup conditionals?
  4. yoghurtfarmer

    yoghurtfarmer Well-Known Member

    Would like to know also!
  5. dutchbb

    dutchbb Well-Known Member

    And locations. If user is in *forum X* show *this banner*. That one seems a bit trickier to do.

    There should really be a sticky with these kind of things...
    BamaStangGuy likes this.
  6. Itworx4me

    Itworx4me Well-Known Member

    Looking for this conditional also....
    ideenwerk likes this.
  7. seneca

    seneca Member

    I'm not managing to figure out how to hide the registered members list from guests and only show it to those logged in.
  8. Brogan

    Brogan XenForo Moderator Staff Member

  9. seneca

    seneca Member

Share This Page