Remove user name from avatar hover on topic page

I want to hide the user real name from the hover that appears when you mouse-over the avatar. The obvious solution is to disable real names, but the admin wants to be able to see real names (but no one else to see).

Pretty much any solution is fine, even making the background and text color the same. I think what I really want to do is change the value of the title property to null, but a simple css-only solution woulc be dandy.

This comes a little close, but the avatar blinks off and on and you can still sometimes get the hover.


.topic-avatar img:hover  {
    display: none;
}

2 Likes

The title attributes are handled by the browser, so it can’t be hidden with CSS.

In a theme I think you’d have to edit the user-avatar helper… specifically

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/app/helpers/user-avatar.js#L70

There might be a better way to limit full names to staff via a plugin… but that’s probably more complex (beyond my knowledge anyway)

6 Likes

Maybe this can be useful:

1 Like