1. 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?

Discussion in 'XenForo Questions and Support' started by Andy Huang, Apr 27, 2011.

  1. Andy Huang

    Andy Huang Well-Known Member

    <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> 
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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>
    
     
  3. Andy Huang

    Andy Huang Well-Known Member

    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 :)
     

Share This Page