How to add a symbol next to someone’s name

AI-generated summary

BodieBlox wants to add a symbol next to a user’s name, specifically for staff group members. HAWK suggests looking into avatar flairs, but BodieBlox is looking for a specific logo next to the name, like the shield mods have. ondrej provides a link to post badges, but BodieBlox wants the icon to show in posts and profiles, only for staff group members. Moin shares a link to making staff users more recognizable. tshenry suggests using the plugin-api to add a poster icon, providing an example code snippet that can be added to the theme to achieve this for posts.

How can I add a symbol next to someone’s name and like if someone is in the staff group I’m trying to add a symbol next to their name just like when you are a mod you have a symbol next to your name.

Take a look at avatar flairs, I suspect that may be what you’re after.

Thank you! (20 chars)

Do you know how to add a logo next to the name like how mods get a shield?

Would this help?

This is what I’m looking for except I want the icon to show in post and when you go to someone’s profile also I only want an icon to show if you are in the staff group

I am trying to make it so staff don’t have to have admin or mod but have like a staff icon like a mod has a shield

We have something in our plugin-api that should be able to help: discourse/app/assets/javascripts/discourse/app/lib/plugin-api.js at 7c7dd2335bb8590935ca6f7c19cec1f07a61412f · discourse/discourse · GitHub

Here’s an example you can put into the </head> section of your theme:

<script type="text/discourse-plugin" version="0.11">
  api.addPosterIcon((cfs, attrs) => {
    if (attrs.primary_group_name === "MY_GROUP_NAME") {
      return { icon: 'shield-alt', className: 'staff', title: 'staff' };
    }
  });
</script>

You will need to replace the MY_GROUP_NAME in the above code with the actual name of your group.

Would something like that work for you? I’m not sure how easy it would be to do the same on the user card/profile, but first see if the above code is what you are looking for on posts.