XF 1.5 how to change post bg color for Specific User-groups?


Active member
Hello guys
I know how to do this for staff members

.messageList .message.staff {
  background-color: #ffaa66;
How about other User-groups? is it possible? :rolleyes:


XenForo moderator
Staff member
There isn't a different class for each user group.
You may be able to achieve it with conditional statements and inline styling or custom classes.
Thank you Brogan, can you give me an example please?

In case anyone didn't know how to do this (I totally was lost for a bit!) you'd edit the message template and on line 4 inbetween the staff code and the ignored code and add something like this

{xen:if '{xen:helper ismemberof, $message, X}', 'donator'}
X being Usergroup ID

Then in your Extra.css you'd add

.message.donator {
background-color: colorcodehere;
This is my entire line
<li id="{$messageId}" class="message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_staff}', 'staff'} {xen:if '{xen:helper ismemberof, $message, 7}', 'premium'} {xen:if '{xen:helper ismemberof, $message, 12}', 'helper'} {xen:if '{xen:helper ismemberof, $message, 11}', 'donator'} {xen:if '{xen:helper ismemberof, $message, 10}', 'PZ'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
For my site I added an image to the top right so it looks like