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

XF 1.2 What variables are available in page nodes?

Discussion in 'XenForo Questions and Support' started by Stuart Wright, Oct 30, 2013.

  1. Stuart Wright

    Stuart Wright Well-Known Member

    I want to address the reader of a page node by name.
    I have set up a conditional to only do it if they are a member.
    How do I display their login name in the page?

    Maybe this could be added to Brogan's page tutorial.

  2. MattW

    MattW Well-Known Member

    EDIT: {$visitor.username} or {$user.username}

    I need to re-install my test board to mess about properly though.
    Last edited: Oct 30, 2013
    Chris D likes this.
  3. Chris D

    Chris D XenForo Developer Staff Member

    The current logged in user is always available in the {$visitor} object. That is available globally.

    {$user} never refers to the current logged in user. In fact, it isn't used in many places. Mostly on profile and member pages. In those cases it only ever refers to the user you're looking at.

    But indeed, {$visitor.username} is correct.
    Stuart Wright and MattW like this.

Share This Page