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

Change Sidebar username

Luke B

Active member
#1
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
 

Jake Bunce

XenForo moderator
Staff member
#2
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.