Is it possible to have the first poster's user group display in the list of the latest/new topics?

Hi folks :wave:

I was wondering if there’s a way to do the following:

  • Whenever a user from a certain group is the first poster/creates a topic
  • Tag that topic with their group name
  • And have that tag (group name) visible only to another user group within the Latest or New dashboards

I’ve looked into flairs, but they don’t do the trick as they’re not visible on the dashboards. Was thinking of creating a custom plugin like suggested here, but we’re not self-hosting so that also doesn’t work.

Thnx!

1 Like

Hi Nemanja :wave:t5: :slight_smile:

What you’ve described would be tricky to achieve right off the bat, but maybe we can still help here. Can you share what you’re looking to achieve with this setup? Maybe we can suggest other ways of doing it, like using category and group permissions or so.

2 Likes

Hi @osioke and thnx for the speedy reply!

What we’re looking into is creating

  • a visually easy-to-spot way for
  • admins/staff to understand
  • what user groups is asking the question

This feature/tag should then only be visible to admins/staff.

2 Likes

Maybe have them post in a category that only that group can create topics in? That’s the easy way.

2 Likes

Thanks for the suggestion! That unfortunately doesn’t work as the topic needs to be visible to the whole community. Tags would be there just for the admins

1 Like

And you want this visual way to be seeable from the latest or new topic view (or as you referred to them dashboard) yeah?

Asking to be certain and to see whether flairs can be made visible from the topic view via a theme component.

Yep, that’s right, wanna see the group that’s asking the question int the latest/new topic views. Thought that tags would be better as flairs can be seen by anyone, not just admins/staff.

Lemme know if that’s an option though :grinning:

1 Like

Using tags dynamically would be going into custom plugin territory, which may or may not work for your use case. So I am looking at other possible ways.

1 Like

Appreciate the help @osioke :pray:

1 Like

And yes! It is possible in a theme component. :slight_smile:

On topics lists we have primary_group_id and flair_group_id of the user that created the topic… so we should be able to grab the relevant group name or flair using that and use it in the views you mentioned.

This is still custom work though, so you can either use our #marketplace to do this or do it in-house. :blush::tada:

1 Like

I think the flair thing might be your solution, but you can make a category that everyone can read and reply to bit only some can start a new topic.

2 Likes

Thnx for the suggestion @osioke, much appreciated. As far as I can tell you’d recommend getting someone from the #marketplace to do the work?

1 Like

Falir is definitely the way I’d go too, but it relies on the group being the primary group of the user-- which fails as soon as the user plays with those settings.

Another alternative for this would be to automatically assign a badge to users in the group. This means the staff can just click the name and see from the profile which groups the person is in – not as immediate as flair, but less likely to suffer from user interferance(users can’t remove badges as far as I’m aware).

SQL query for the badge, where in this example “discourse-admins” is the Group slug.

select user_id, created_at granted_at, NULL post_id
from group_users
where group_id = (
  select g.id from groups g where g.name = 'discourse-admins'
)

And these are the settings
image

1 Like

Yup! I’d also advice doing due diligence as you pick someone from there. If you have any concerns with this, please let me know :slight_smile:

Also see @Tris20’s comment too, it may not be what you want, but it is still a neat idea.

Thnx for the suggestions @pfaffman and @Tris20, appreciate the help :pray: We’re looking into a solution that’s visible from the new/latest views so custom theme component might be the best option.

2 Likes