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

craigiri

Well-known member
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?
 
Admin CP -> Appearance -> Templates -> message_user_info

Replace the red code:

Rich (BB 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:

Rich (BB 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.webp
 
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....
 
Top Bottom