Ability to assign icons to user groups

Would like to be able to assign icons to user groups, and have them display next to the username in posts, on profiles, and on profile cards, the same way the half-shield is shown for admins and moderators. Also, the ability to easily change the icons for mods and admins.

Should be very simple as a core feature.

I know you can add avatar flair to a group, but that just doesn’t look good. Having the icon next to the name is ideal.

2 Likes

So if you grant this badge and add the user to the group, then add these badges to the badges setting of this Theme Component (if you installed it), it should display next to the username.

However, there is most likely a simpler way, except that it would need some code as a Theme Component.

4 Likes

Yeah I tried using this. Doesn’t work. Trying to find a much simpler way. The add that shield icon to mods and admins. Has to be a way to apply icons to tother groups. Seems to many simple things are very difficult.

I can try tinkering with this idea and see if I can make it work. No promises, though, as I’m quite busy today. But I think it’s certainly possible.

To confirm, you only want this to show in posts? Or everywhere?

2 Likes

Posts, Profile card, profile page, etc.

Just like the default admin/mod shield icon. It displays next to the username all over.

And THANK YOU. Would be awesome to have the ability to do this!

Okay so it looks like it’s more complicated than it seems? The icon is made in a function, so I can’t override it (I think?). It would likely have to be DOM manipulation.

Also, should this be moved to a separate topic?

@long I’ll continue to look for solutions to do this (not giving up yet!)

3 Likes

Thank you! I spent a few hours with ChatGPT last night and couldb’t crack it.

Can you elaborate? it’s not likely we’d add a dedicated feature that’s essentially the same as flair but in a different position, so it would be helpful to know what the issues with flair are if it needs to be improved.

A theme component is the best way to go about this, but there are going to be multiple paths to add it in different contexts (in posts, on profiles, in the user directory, etc) .

I’ve built an example theme component here — this shows the group flair icon after the username in the post, rather than on the avatar.

I think you could give us a little grace here, there are many platforms where a change like this isn’t possible at all!

6 Likes

This is exactly what I was looking to do. The “Flair” is the same icon…just not in the best position as some user profile images make it hard to see.

That other part should have been “so” many….not too. And it wasn’t directed at Discourse. It was directed at mysefl lol. I’m not the best at this stuff. I will check out that component later today! Also, I figured out how to accomplish some things in the Signatures plugin – not sure if these tweaks are helpful to be added to the plugin.

2 Likes

@long I think I managed to do it.

Note that if the user is in 2 groups where both are in the settings, the first one in the settings takes precedence.

Settings are pretty self-explanatory:

Please report back if you have any problems!


Note that this is just a proof-of-concept. I will not be maintaining this forever.

7 Likes

Amazing, will check it out!!!

1 Like