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

XF 1.4 Img and avatars

RichardKYA

Well-known member
#1
Hey all,

What is changing "true" to "false" meant to do inside the img tags?

Code:
<img src="{xen:helper avatar, $visitor, s, 'true'}" alt="{$visitor.username}" style="{xen:helper avatarCropCss, $visitor}" itemprop="photo" />
I can't see any difference when I do it. I was hoping it had the same effect as changing it inside the <xen:avatar> tags where the image is displayed as a background image.

The trouble I am having is that I am trying to make the member_view avatar square and scalable, but to do that I have to use the <xen:avatar> tags instead of the <img> tag, but the problem with that is that the <xen:avatar> automatically comes with a link to the profile page which you are already on.

I want the image to link to the avatar editor, but I can't do that unless I use code above wrapped in a link, which is fine, but then I can't scale the image because adjusting the dimensions throw off the centering and if you have a landscape image or portrait image (not square) uploaded then you only see half the image.

This is what I have at the moment, which is fine for a 347x192px image cropped at 192x192px and centered perfectly...

Code:
<div class="avatarCropper">
           <xen:if is="{$visitor.user_id} == {$user.user_id}">
         <a class="OverlayTrigger" href="{xen:link account/avatar}">
           <img src="{xen:helper avatar, $user, l, '', true}" alt="{$user.username}" style="{xen:helper avatarCropCss, $user}" itemprop="photo" />
         </a>
         <xen:else />
           <img src="{xen:helper avatar, $user, l, '', true}" alt="{$user.username}" style="{xen:helper avatarCropCss, $user}" itemprop="photo" />
         </xen:if>
         </div>
Is there either..

a) a way to prevent that one <xen:avatar> tag only from linking to the profile page so that I can wrap it in a avatar editor link?

or b) a way to get the img tag to display as a background-image so that I can center it accordingly for scaling?

Hope that all made sense :)

Thank you