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.
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.
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.
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
where group_id = (
select g.id from groups g where g.name = 'discourse-admins'