• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

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

Ranger375

Well-known member
#1
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.

Thx
 

Jake Bunce

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

Add this code:

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

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

<div class="messageUserInfo" itemscope itemtype="http://data-vocabulary.org/Person">
	<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>

	</h3>

	<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.
 

Ranger375

Well-known member
#3
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?
 

Ranger375

Well-known member
#5
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.