XF 1.5 How can I call a username inside a template?


Active member
I tried adding this line:
<xen:username user="$user" itemprop="name" rich="true" />

And ended up with this error:
Typically you would use $user.username or $visitor.username, depending on the template in question.

That particular error is related to the rich user name add-on though so you would need to contact the author for additional support related to it.
I'm adding this in the conversations. I tried {$visitor.username} and it showed up. However, it's only showing my username, not the corresponding usernames of conversation participants.
It wouldn't - that variable isn't for the list of conversation participants.

Have a look at the template to see how that list is being called.
The conversation template is using the message template. What I did was I removed the messageuserinfo div.


What I wanted to achieve is to have the username on the top left corner and beside that is the online indicator. Right now, this is what's showing up with the visitor code.
Top Bottom