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

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

Discussion in 'Styling and Customization Questions' started by Blast, May 25, 2016.

  1. Blast

    Blast Active Member

    I tried adding this line:
    <xen:username user="$user" itemprop="name" rich="true" />
    And ended up with this error:
  2. Brogan

    Brogan XenForo Moderator Staff Member

    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.
  3. Blast

    Blast Active Member

    Hey @Brogan. How would you insert that? Via helper?

    {xen:helper $user.username}?
  4. Blast

    Blast Active Member

    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.
  5. Brogan

    Brogan XenForo Moderator Staff Member

    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.
  6. Blast

    Blast Active Member

    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.
  7. Blast

    Blast Active Member

    Would appreciate any help in here.

Share This Page