I agree that option (perhaps as global setting) to display mention as @sam OR as Sam Saffron
would be really great.
With the same formatting as mentions now have, but displaying full name instead of @handle
So, you guys allow for SSO logins, presumably to allow for companies, anong other entities who maintain master employee/user lists to login with ease.
The issue Iām running into here is this. We have 4500 employees. Most donāt know each other. While tagging by typing name in works perfectly fine, the username displayed is a 5 digit employee #. So now all people see is comeone tagging a 5 digit #
Can you guys write/enable a user option that simply displays the Full Name field in lieu of @username please!
You allow a user option to select the Full Name displayed first in a thread reply with username to the right. A simple visual switch.
I totally get the purpose of using a ātwitterā tagging model, but it is severely aggravating for large professional/educational institutions to use. Please, please make an option available. In any means.
Itās not even in a paid hosted/supported version, so youāre missing out there on revenue for large organizations who might otherwise use this.
In my case, Iām trying to āsellā it to my board to adopt discourse. Iām sure they wonāt like this missing capibility
Who decided the username had to be a 5 digit number? Thatās a bad decision.
Itās quite common from what I have seen in larger organisations to have their AD logon use their payroll or ID number in order to logon rather than names. Not necessarily 5 numbers however. For example my last organisation my login was B3293016 - would be difficult to distinguish who that is if they then used SSO to check against that login and use it for discourse username and mentions.
What @mikechristopher said. The 5 did fit # is our employee Iād. Technically itās 6, but the zero at the beginning is left off as we havenāt reached numbers greater than 100,000.
Bottom line, again having the feature I described will give corporate/enterprise clients a lot better usability.
Had you not integrated SSO, Iād understand being reluctant to allow full name tags vs username. But you made SSO available, this is a logical next step enhancement
I am not against adding this kind of option, but at the moment none of our paying customers need it so I cannot prioritize it.
I would probably recommend building this as a plugin first, this is something I would consider building if an enterprise customer funded it.
Havenāt tried it, sorry. Just threw out the idea, but this isnāt something Iāve felt the need to explore too deeply personally.
Just to beat this dead horse a bit more, one of the barriers weāre having in our group is that people get super easily confused by the usernames. So right now, they have no problems making mentions, but when reading, they often donāt know who the mentioned person is. As such, in our use case, @cpradio (Jim Smith)
would be ideal. The user would type in the @mention (letās say @cpradio
) and it automatically turns into @cpradio (Jim Smith)
for others to read.
This would be just like the username mentions by each of our posts.
Has there been any movement here? Itās annoying to have to click on a username to figure out who the actual person is. And trying to move from Facebook Groups to Discourse is a pain when donāt get to see full names by default. I donāt think uniqueness is really the problem that people think it is from reading previous comments, as, once again, you can use usercards to differentiate if thatās the case. Iāve already changed the site settings to prioritize full names in UXā¦
I made a quick script that does this. I put it in a component, in the </head> section, and it works. It could definitely be improved upon, but here it is.
<script type="text/discourse-plugin" version="0.1">
var decorateAtMentions = function($post) {
$post.find("a.mention").each(function() {
var $elem = $(this);
var username = $elem.text().substr(1);
var data = Discourse.User.findByUsername(username).then(function(user) {
var avatarurl = user.avatar_template.replace("{size}", 18);
var realname = user.name;
$elem.before("<img src='"+avatarurl+"' title='"+realname+"'>");
$elem.attr("title", realname);
$elem.after("["+realname+"]");
});
})
}
api.decorateCooked(decorateAtMentions, {id: 'decorate-at-mentions'});
</script>
The title in the img tag is a potential problem if a name has a single quote character, so it needs to be done āthe right wayā (myself, Iāll probably remove it since I donāt really like it that much).
I wanted to change the link text, instead of appending the real name at the end, but unfortunately that breaks the click handler for the user card (since it apparently relies on the mention text to load the name) and I didnāt want to go down that rabbit hole.
That sounds great. For a novice, do you have a step-by-step guide on how to actually add that to my discourse instance?
There is already a guide, please read
and create your first theme component.
@nachof I found a way to make it work: https://gist.github.com/jessicah/cd580bab64d89875a157579789b03511 by overriding _show()
in component:user-card-contents
. Iām guessing the leading underscore means we probably shouldnāt override it? But it seems to work:
Perhaps there needs to be an entry point to optionally get the username from $target
? Anyway, this was really a blocker from my POV to deploying to my wider community. Time to roll ahead
This is amazing! Iām not a software developer so I couldnāt figure out how to add what you created to my Discourse site. I tried using this url to install via git repository but it asked if I was sure this was a Discourse theme. What steps should I be taking?
You would create a new theme component from the UX and paste that stuff into the head tag
part of the theme.
Sorry for beating the dead horse for the 100th time, but I installed it correctly and it will not display the user cards, any fix for this since this was 2 years ago?
I know there is a fairly low chance that youāll go through the work reprogramming it, but maybe some nice community member will help this out.
Iām honestly still pretty lost with these directions. Your help on What makes a successful volunteer Discourse sysadmin? is super helpful, but I havenāt found that volunteer yet.
In the meantime, @jessicah , are you still around to maybe make this a theme component that is published in #theme-component ? Or is someone else able to make a working theme component?
This theme component has caching, which solves the problem with the quick script posted by @nachof earlier: it ends up firing a crazy number of requests while drafting posts that hit rate limits and make the composer UI break.