Highlight moderator messages

I’m currently working on moving an existing forum over to Discourse. So far they used the [color] tag to color any moderation related messages by a moderator in blue (instead of black default text) to show that this part of a post is related to moderation instead of just a normal part of the discussion.

For various reasons I think this is a bad idea but they still want to keep highlighting. So I was thinking about a different way to do it. Did anyone yet do a similar thing? I was thinking about putting a frame around it and attach a little text tag to it like “Moderator’s message” or something similar.

This should be doable, right? Maybe something like a custom code/tag/bbcode? Maybe something does exist already to help do this?

Any hint would be appreciated.

1 Like

If you click the button under the post, then the :wrench: you should see a “add staff color” option. Is that what you’re looking for?

I’ve done it to this post, for example.

11 Likes

oh wow - looks like I didn’t use discourse intensively enough yet. Thanks, that was what I was looking for. It only seems to work for a full post and I was more thinking about only for a certain part of the post but that’s definitely good already.

4 Likes

You also have the option to add a staff notice (the option is right below staff color), which will add a separate little section like this above any post:

If you really want custom code for only some content in a post you can do that too with a some customization (Generic bbcode wrapper for theme components).

So for example, if I wanted to highlight only some text I can wrap some text in my post

[wrap=mod-color]
This is my official moderator warning!
[/wrap]

Then in your theme’s custom CSS you can add this (admin > customize > themes)

.topic-post.group-team [data-wrap="mod-color"] {
   background: yellow; 
   color: red;
}

The important thing to note with this method is that to prevent normal users from using the same code you’ll need to create a new group, and that group would have to be the moderator’s primary group (primary group is configurable from an individual user’s admin page). In my example above I’m using a group named “team”, which is where .group-team comes from.

9 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.