XF 1.2 What variables are available in page nodes?

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.



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