Adding an image under custom title for each user group??


Well-known member
How can I add an image under the custom title area in the post bit. I am trying to do this so it is user group based, so essentially each usergroup would have its own image.


Jake Bunce

XenForo moderator
Staff member
Admin CP -> Appearance -> Templates -> message_user_info

Add this code:

                <xen:if is="{$user.user_group_id} == 2">
		    <img src="PATH/TO/image.gif" />
                </xen:if> shown below:

<xen:require css="message_user_info.css" />

<div class="messageUserInfo" itemscope itemtype="">
	<div class="messageUserBlock">
		<div class="avatarHolder"><xen:avatar user="$user" size="m" itemprop="photo" /></div>

<xen:if is="!{$isQuickReply}">
	<h3 class="userText">
		<a {xen:if $user.user_id, 'href="{xen:link members, $user}" '}class="username" itemprop="name">{xen:helper richUserName, $user}</a>
		<xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user}</xen:contentcheck></em></xen:if>

                <xen:if is="{$user.user_group_id} == 2">
		    <img src="PATH/TO/image.gif" />


	<xen:if hascontent="true">
Change the image location and usergroupid number appropriately. You can add more instances of that code to cover other groups.

edit - this only checks the primary usergroup.


Well-known member
So basically to get this to work how I want it to is to make several primary usergroups, rather than having everyone as registered with a subgroup?


Well-known member
One of the posts in the tips and tricks forum shows that you can add an image to the side of your user name with the following code:

font-family: "Lucida Grande" ,Helvetica,Arial,sans-serif;
font-weight: bold;
color: #73427c;
background-image: url(styles/default/xenforo/smilies/admin.png);
background-repeat: no-repeat;
padding-left: 13px;

Is there a way to modify this code to have the image appear below, rather that to the side? The above
code is placed in the usergroup css section, and would solve my problem.