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

XF 1.4 Remove avatar if user have no avatar

Discussion in 'Styling and Customization Questions' started by Tonny Kluften, Sep 24, 2014.

  1. Tonny Kluften

    Tonny Kluften Member

    How can I remove the avatar if a user have no avatar?
    It does not look very nice with all that default avtar images.

    Thanks!
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    It would require editing the template(s) and using a conditional statement related to whether an avatar or gravatar is being used.
     
  3. Tonny Kluften

    Tonny Kluften Member

    Yes, thanks. But I have no clue on how to make that conditional statement.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    <xen:if is="!{$user.avatar_date} AND !{$user.gravatar}">
     
  5. Tonny Kluften

    Tonny Kluften Member

    Thanks again Brogan. I am new to this wonderful software Xenforo and my knowledge is limited.

    I use this, then the avatar to the ones who have an avatar disappeared, how can I achieve the opposite?:

    <xen:if is="!{$user.avatar_date} AND !{$user.gravatar}">
    <div class="avatarHolder">
    <span class="helper"></span>
    <xen:avatar user="$user" size="m" img="true" />
    <xen:if is="{$user.isOnline}"><span class="Tooltip onlineMarker" title="{xen:phrase online_now}" data-offsetX="-22" data-offsetY="-8"></span></xen:if>
    <!-- slot: message_user_info_avatar -->
    </div>
    </xen:if>
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    You need to change it to <xen:if is="{$user.avatar_date} OR {$user.gravatar}">
     
  7. Tonny Kluften

    Tonny Kluften Member

    Thats it. Thanks again for your help.
    I see that you are a great resource here. Hope you know that you really are making a difference for us beginners.
     

Share This Page