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.
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
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.
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.
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
from group_users
where group_id = (
select g.id from groups g where g.name = 'discourse-admins'
)
Thnx for the suggestions @pfaffman and @Tris20, appreciate the help We’re looking into a solution that’s visible from the new/latest views so custom theme component might be the best option.