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

Basic variables like username

Morgain

Well-known member
#1
How do I make a username appear in the text on an XF html Page?
or in the Page Title?

Also is there a list anywhere of basic variables like that?
I used to use one on another forum software which was very useful. I think that was $user
 

Morgain

Well-known member
#3
Jake you're a darling as always.
I got that to work in the Page body.

Any chance of making the user's name appear in the Page Title -
(the large title which shows on the Page with a line of small description text underneath it)

so it could be called XXXX's Toybox - or whatever.
 

Jake Bunce

XenForo moderator
Staff member
#4
Most of the "view" templates have a xen:h1 tag at the top. That is where the title is defined. You can add the username variable to that tag. For example:

Code:
<xen:h1>{$visitor.username}'s Toybox</xen:h1>
 

Morgain

Well-known member
#5
Jake that's very satisfying.
What if it's a visitor not logged in?
How would I make it say "My" instead of the username?

Also I put
Code:
{$visitor.username}'s Toybox
in as the Title in the admincp edit form but what appears in the node list is the code, not my name.