Trust-Level Avatar Flair

This theme component allows an admin to add flair to user avatars based on the user’s trust level. Trust level flair displays anywhere on the site that you would normally see group flair. There are a few theme settings to adjust the position of the flair in relation to the avatar.

Basic Examples (with group flair in place)

There is also a bottom-right position that will either replace group flair or be replaced by group flair depending on how you set the “group flair always on top” setting.

Main setup

Using images as flair

You will need to add your own flair images to the theme component. A good size is around 100×100px. The one I used in the example above is 88×88px. You can download a transparent template image here to get started if that’s helpful:

The easiest way to upload an image is to create a separate “Trust Level Avatar Flair Assets” local component (instructions here for those unfamiliar). When viewing the assets component, select the + Add button under the Uploads section of the theme component and choose your flair image file. Repeat this for each flair image you want to include. Once you have the images uploaded, right click on the image link and copy the url of the image. Finally, paste the url into the trust level field of your choice.



Using Font Awesome for your flair

You can use Font Awesome icons instead of using uploaded images. A full list of available icons can be found here. All you need to do is check the setting to use Font Awesome then add the name of the icon to the appropriate flair image field:

IMPORTANT NOTE: Currently you cannot mix Font Awesome and images, if there is a strong interest in doing so, I can look into it further.

Settings

You will find that there are several settings available within this theme component. They have descriptions explaining what they do and how to use them, but if anyone has an suggestions on how to improve them to make things more clear, please let me know!

Hovering over the trust-level avatar flair will display the name of the trust level. If you wish to change the name of the trust level, you can go to Admin > Customize > Text and search for the following to change the names:

  • js.trust_levels.names.newuser
  • js.trust_levels.names.basic
  • js.trust_levels.names.member
  • js.trust_levels.names.regular
  • js.trust_levels.names.leader

Please feel free to post if there are any questions, problems, or suggestions!

56 Likes

Is there any chance of this eventually supporting group flair?

2 Likes

I’d like this particular component to remain focused on trust-level, but that doesn’t mean I’m not open to exploring something similar for group flair.

I looked back at your original request.

I’ll need to look into how doable this is with a theme component. I suspect that accessing the full list of groups a user belongs to would require a plugin that adds that info to the appropriate serializer, but I could be wrong. I will let you know if/when I have good news. I have a pretty full plate at the moment, so it could be a while before I have an update.

6 Likes

That’s very kind of you. I’m not familiar enough yet to know what can be done with themes vs plugins.

wow, i love it, i’m using it only for my trust level 4 leaders.

i have so many groups, and they all have different flairs, and so many colored name tags, that this is nice so the community and the new users know who are the leaders and the mods and are there to help them out

2 Likes

Taylor

Whats the chances an admin option, or user option could be added to remove this per individual request?

If that’s a bit much to ask could you provide the css to add that might remove for an individual?

Thank you :slightly_smiling_face:

1 Like

A new setting for users or admins is a bit more than I am interested in adding at this time, but I have just pushed a update that will add a new class to the trust level avatar flair element so you can target a specific user. Replace USERNAME with the username of the relevant user to hide the flair from their avatar:

tl-flair-USERNAME {
    display: none !important;
}
5 Likes

:warning: IMPORTANT: if you had previously uploaded flair image files directly to this component you will need to re-upload your flair images to a separate component before updating. Please see below.

I’ve just pushed a small update and edited the OP of this topic. Adding the icon assets directly to this component is no longer supported. When a remote theme component is updated all of the manually uploaded assets are deleted as it tries to sync with the remote GitHub repository. This can create a confusing/annoying situation for admins so we now block adding uploads to remote themes altogether.

The new reccomendaation is as follows:

Please let me know if you have any question or trouble figuring out the new setup.

3 Likes

Hi @tshenry and thanks for all the work :slightly_smiling_face:
I need for my forum to display a second flair (I already have the primararly displayed group) from a second group.
This Trust-Level Avatar Flair theme component would be perfect, I just need it to be able to display 10 groups (levels of access of my Discourse).

I read you were opened to that idea in 2018, do you still think it is possible ? :slightly_smiling_face:

2 Likes

I’m currently using this:

2 Likes

Yes, I thought so and I tried but the badges with this component are so small they are hard to see…
I trully wish we could use flairs and avatars with second groups :slightly_smiling_face:

3 Likes

Sadly, I don’t think it is possible with a theme component at the moment. I don’t believe we serialize the required group data in all three of of the avatar flair contexts, only the primary group. At this point I think it would need to be done as a plugin. Unfortunately, I don’t have the bandwidth to work on something like that at the moment. You could always try the marketplace if you need someone to help you build a solution for your site.

3 Likes

Is it possible to use this feature but have different trust flairs ONLY if someone ALSO belongs to a particular group?

Example: I want flair for people in one group and not another.

Hello Taylor,

Thanks for this TC. I notice this Deprecation warning which may cause problems after update to Ember CLI. I would be appreciate if you could fix it. Thank you :slightly_smiling_face:

3 Likes

Thanks for the heads up! You should be all set once you update the component:

3 Likes

It can be disabled for staff members?

1 Like

The trust levels of users is now displaying on the bottom left of a user post instead of being included within the user’s photo/avatar flair.

Anyone experiencing the same?

1 Like

Hello Alan :wave:

Are you talking about this theme component?

2 Likes

That’s the one @ondrej

Instead of being placed within the image - it’s place at the bottom left.

So where I’ve circled above.

1 Like

Hi @Arduous! :wave:

I’m glad @ondrej pinpointed the component affected. :tada:

Have you checked the web console to see if there are an errors on the site? Is it possible to share a link to the affected site we could look at? :slight_smile:

3 Likes