• 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?

Stuart Wright

Well-known member
#1
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.

Thanks
 

MattW

Well-known member
#2
EDIT: {$visitor.username} or {$user.username}

I need to re-install my test board to mess about properly though.
 
Last edited:

Chris D

XenForo developer
Staff member
#3
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.