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

When user has no avatar - is smaller avatar block available?

craigiri

Well-known member
#1
As the title says - many conversations involve short sentences and posts - yet XF themes often take up a lot of room with the avatar holding area, so lots of scrolling has to be done.

Is there a way to make it so when the user has not uploaded an avatar, that the block is shorter?
 

Jake Bunce

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

Replace the red code:

Code:
	<xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
		<div class="avatarHolder">
			<span class="helper"></span>
			<xen:avatar user="$user" size="m" />
			<!-- slot: message_user_info_avatar -->
		</div>
	</xen:hook>
Like so:

Code:
	<xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
		<div class="avatarHolder">
			<span class="helper"></span>

			<xen:if is="{$user.avatar_date} OR {$user.gravatar}">
				<xen:avatar user="$user" size="m" />
			<xen:else />
				<xen:avatar user="$user" size="s" />
			</xen:if>

			<!-- slot: message_user_info_avatar -->
		</div>
	</xen:hook>
The result:

Screen shot 2012-01-22 at 1.04.43 AM.png
 

craigiri

Well-known member
#3
Cool, Jake!
Thanks. Thats's one way of doing it.
I suppose the same code could probably call a completely different avatar or place keeper....one which was as wide as the big avatar, but only a could pixels high....