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

Appending something to username via template?

Andy Huang

Well-known member
#1
<xen:username> tag gives a nicely formatted link, which is great.
What if I want to append something to username via template?

For example:
Code:
<xen:username user="$user" itemprop="name" rich="true" />
Generats:
Code:
<a href="members/someone.1/" class="username" itemprop="name"><span class="style3">Someone</span></a>
What if I want it to generate:
Code:
<a href="members/someone.1/" class="username" itemprop="name"><span class="style3">Someone</span> <span class="userTitle">(blah blah blah)</span></a>
 

Jake Bunce

XenForo moderator
Staff member
#2
XenForo_Template_Helper_Core::userNameHtml

In looking at the code I don't see any option for that.

You can use a separate call for the title:

Code:
<span class="userTitle">{xen:helper usertitle, $user}</span>
If you want it hyperlinked then it's this:

Code:
<a href="{xen:link members, $user}"><span class="userTitle">{xen:helper usertitle, $user}</span></a>
 

Andy Huang

Well-known member
#3
Ah, I'm not appending user title... I'm interested in appending something using userTitle class text.
So I guess I'd need to rebuild the link manually via template, then. Okay, thanks :)