Add styles to a topic listings based on if a specific group (such as staff) has posted inside the topic

Hello, i’ve been searching for something like this by every name I could think of, and figured at this point my best bet is to ask here if there is anything like this (maybe a published theme component) and if not, add it as a feature request.

The idea is, I could flag a group (in my sake, Staff) , and any time staff post inside a topic, in the listing for that topic, id like to add a class, so that I can add maybe an icon, or a background image indicating that a staff member has replied inside the topic.

Bonus points if there was a way inside the topic to be able to jump to each staff post, but that I feel is bonus and outside a basic scope.

We have a plugin for this (though it doesn’t look like we have it documented here on Meta anywhere :thinking:): GitHub - discourse/discourse-group-tracker: Group Tracker plugin for Discourse

This allows you to add an icon to the topic list to mark topics where someone from a specific group has posted, and also covers this:

Also, within topics… as long as the group is set as someone’s primary group, we add a class to each post (using Meta as an example, our team members have group-team added to their posts:

1 Like

Oh that is fantastic, going to try out this plugin right now.

as for the bonus part → Yeah, im using that class right now to style the post of staff adding a gradient background image. I guess I could make a little js that auto jumps to a post based on if it has that class as well to solve it.

1 Like

Hey @awesomerobot

I got the plugin successfully installed (as can be seen in this screenshot)

However, according to the github instructions, in order to add a group

In the “Manage” section of the group you want people to be able to track, enable the “Track posts made by members of this group” checkbox.

however, there is no such option in the manage section of a group.

currently, all topics are being flagged with the icon

hmm, If I recall correctly the plugin doesn’t work for automatic groups (the ones that come with Discourse by default), which includes trust levels, moderators, and staff… so I think you have to create a new group, and on that group you should see the settings.

Yep! you just beat me to it, Made a new staff group and its working like a charm.

Thank you so much, this plugin is spot on

1 Like

Noticed it looks like this does not apply the class any time a post is quoted in another topic (which means there is nothing to tag it with the same styles that it has in a topic itself [For example, changing the text color of staff posts])

If this plugin where to ever get touched again, that would be a good addition.

Edit: Looking at this very site (meta) the quotes actully do have a class for the group (some have no-group, team members who are quoted have group-team) so it looks like this is indeed supported?

I like that idea. But it change to useless if there is more generic topics or staff (or what that group is) are more active writers. So, they should have separate accounts depending if they are giving support (os similar where that notification is needed) than if they are participating otherwise.