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

Change Sidebar username

Discussion in 'Styling and Customization Questions' started by Luke B, Oct 24, 2011.

  1. Luke B

    Luke B Active Member

    Hello all,

    I have an easy question (at least I think its easy). I'm trying to change the user name next to the avatar on the sidebar to read "hello" instead of the users name (I find it redundant because the users name is right above in the navigation).

    I've created a new phrase for hello (called hello)

    I've located the code for the name in the sidebar
    Code:
    <h2>{xen:phrase signed_in_as_x_sidebar, 'name={xen:helper username, $visitor, 'NoOverlay'}'}</h2>
    When I change the xen: phrase to hello, it changes on the front end but the font styling is missing.

    How do I alter the code above to maintain the styling of the username?

    Thank you much
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That username helper returns a hyperlink with class "username". That is where the styling comes from. You can manually specify the class like this:

    Code:
    <h2>{xen:phrase signed_in_as_x_sidebar, 'name=<span class="username">{xen:phrase hello}</span>'}</h2>
    
    Or you could put the HTML into the "hello" phrase itself.
     
    Luke B likes this.
  3. Luke B

    Luke B Active Member

    Fantastic! Just what I needed.
    Thank you Jake
     

Share This Page