Avatar Flair (not Badges) for Groups

AI-generated summary

The discussion revolves around implementing Avatar Flair (distinct from badges) for groups in Discourse, allowing users to display small icons or symbols on their avatars based on group membership. neil initiated the idea, referencing existing implementations on other platforms like Twitter and Turtle Rock, and proposed integrating it directly into Discourse. The feature would be configured in group settings, with options for custom icons (including Font Awesome) and colors. tobiaseigen requested Font Awesome support, which neil added. The flair is currently displayed beside posts and on user cards, but only for users whose group is set as their primary group—a limitation noted by tobiaseigen and others, prompting suggestions for helper text. Tom_Newsom emphasized the need for flair to appear next to usernames to indicate authority, while BenLeong reported positive feedback from using it for staff and moderators. Martin_Cash suggested improving the hover tooltip to use the group’s full name instead of its database value. dax raised concerns about flair priority when a user belongs to multiple groups with flairs, noting that the last modified group takes precedence, with a workaround involving manual admin adjustments. The feature is now live on Meta, with ongoing refinements.

A customization that people keep asking for is to show a little badge on user avatars based on group membership. This was first done on the Twitter Developers forums:

and has since sprung up here on Meta, on Turtle Rock in multiple forms, and other places.

Those are implemented with CSS which is fragile and often renders them where they shouldn’t…

It’s time to build this into Discourse!

Badge?

First, I don’t know if “badge” is the best word for them because we already have Badges. Is there another term we could use?

Group settings

Since these avatar badges are shown based on a user’s primary group, they can be defined in the group settings. I imagine something like this:

Some other additions:

  • include these badges by default for the admins and moderators groups.
  • ability to show these based on trust level?
36 Me gusta

I’ve seen a lot of sites using “flair” for this.

1 me gusta

Yeah I’ve been using that too.

9 Me gusta

How many pieces of flair can we add to our avatar? Because Brian has thirty-four thirty-seven.

STAN
I need to talk about your flair.

JOANNA
Really? I have 15 buttons on. I, uh, (shows him)

STAN
Well, ok, 15 is minimum, ok?

JOANNA
Ok.

STAN
Now, it’s up to you whether or not you want to just do the bare minimum. Well, like Brian, for example, has 37 pieces of flair. And a terrific smile.

JOANNA
Ok. Ok, you want me to wear more?

STAN
Look. Joanna.

JOANNA
Yeah.

STAN
People can get a cheeseburger anywhere, ok? They come to Chotchkie’s for the atmosphere and the attitude. That’s what the flair’s about. It’s about fun.

JOANNA
Ok. So, more then?

STAN
Look, we want you to express yourself, ok? If you think the bare minimum is enough, then ok. But some people choose to wear more and we encourage that, ok? You do want to express yourself, don’t you?

JOANNA
Yeah. Yeah.

STAN
Great. Great. That’s all I ask.

JOANNA
Ok.

I thought I remembered you saying that you wanted to express yourself.

14 Me gusta

This is mostly done. It shows the flair on avatars beside posts for now. While testing, this was crying for an optional color field too, so I added it.

10 Me gusta

Is this still on the agenda?

I would love to be able to do this for multiple groups rather than just the primary one. Although I’d have thought they’d be small grey ones like the Moderator shield. You could have a dozen and it’d still be fairly unobtrusive.

1 me gusta

How would you display a dozen (or thirty-seven) flair on one avatar??

Yes, although I don’t have images for them… What should they be?

Not on the avatar, on the username.

My particular use case:

We have teams (groups) responsible for different areas of a workshop. Some people are members of multiple teams. It’s good to know what authority a person holds when you’re talking to them. “Ah, I’d better listen to what Jane says about the oscilloscope; she’s got a little lightning bolt by her name which means she’s an electronics technician”

EDIT: My html bodging made the user info bits display on new lines. ignore that :smiley:

11 Me gusta

Maybe something like this?

Hey, I’m just looking into avatar flair and really like it! Nice work, guys. :rocket:

While experimenting with this on my site, I was expecting/hoping to find the ability to add font awesome class icons, similar to adding badges. Is there a particular reason this was not done for flair?

8 Me gusta

Good idea. :thumbsup:

3 Me gusta

Hmm.. I’ve configured the avatar flair field but nothing is showing up in discussions. Is there something else I need to do to make flair show up, like add custom css or run a sidekiq task?

2 Me gusta

Same issue here ..

2 Me gusta

nice to know I’m not alone. :wink:

1 me gusta

Ah - I got it working on my site. @kuyashi.. the answer is that you have to select the “automatically set as primary group” for the flair to show up. I guess it has to know which one takes priority.

3 Me gusta

Thanks @tobiaseigen :wink:

1 me gusta

Only the primary group for the user will show it. A user could be a member of 10 different groups, etc.

4 Me gusta

when you’re at the bleeding edge, you gotta love the undocumented features! :slight_smile:

not even sure actually what “automatically set as primary group” means. Does this mean that when the person is awarded the badge, their “primary group” is set to this group from whatever it was previously? Does primary group have any other purpose?

If you couple a primary group with the “default title” setting, you can automatically assign helpful titles to users. I use this at my system for displaying a user’s institution (automagically maintained by email address).