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

No avatar if none is provided

Discussion in 'XenForo Suggestions' started by Adam Howard, May 1, 2014.

  1. Adam Howard

    Adam Howard Well-Known Member

    XenForo uses the simple grey avatars when a member does not upload their own. I would love an option that if someone does not supply an avatar, no avatar is displayed for that member.

    So rather than this:
    J0u1P1k.png

    You would have this (if no avatar was uploaded by the user)
    rAbKh8y.png

    I think is more cleaner looking than seeing the same dull 'default' repeated.
     
    Last edited: May 1, 2014
    rafass, 51463, mono and 3 others like this.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    If you want to achieve that now, it can be done with a template edit and conditional statement.
     
    Amaury and Adam Howard like this.
  3. Adam Howard

    Adam Howard Well-Known Member

    Oh really? Yes please, do share this knowledge.

    I tried doing this myself via template edit, but was fairly sure it would need some sort of code change in the core files.
     
  4. Russ

    Russ Well-Known Member

    Haven't really tested it much but in message_user_info:

    Code:
      <xen:if is="{$user.avatar_date} AND {$user.gravatar}">
         <div class="avatarHolder">
           <span class="helper"></span>
           <xen:avatar user="$user" size="m" img="true" />
           <!-- slot: message_user_info_avatar -->
         </div>
         </xen:if>
    
    Add the conditional around the avatarholder div.

    preavatar.png

    preavatar2.png
     
    Adam Howard likes this.
  5. Adam Howard

    Adam Howard Well-Known Member

    NOPE. :(

    That hides everyone's avatar.

    What I want is if no avatar is supplied, that none will be shown. But if you supply an avatar, yours should show. ;)
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    It should be <xen:if is="!{... for false, <xen:if is="{... for true.
     
    SneakyDave likes this.
  7. arms

    arms Active Member

    Shouldn't the AND be an OR?
     
  8. Adam Howard

    Adam Howard Well-Known Member

    Again, not what I'm talking about or looking for.

    Let's use this thread as an example
    http://xenforo.com/community/threads/may-day-2014.73331/#post-759721

    How it is NOW
    UMaZOPR.png


    What I am suggesting (looking for)
    Screenshot_1.png
     
  9. Russ

    Russ Well-Known Member

    Try this instead?

    Code:
        <xen:if is="!{$user.avatar_date} AND !{$user.gravatar}">
         <xen:else />
         <div class="avatarHolder">
           <span class="helper"></span>
           <xen:avatar user="$user" size="m" img="true" />
           <!-- slot: message_user_info_avatar -->
         </div>
         </xen:if>
    
    :
    Screenshot_1.png

    I'm no good with conditionals :)
     
    rafass likes this.
  10. Amaury

    Amaury Well-Known Member

    How would work in other areas, such as the member card and Staff Online Now block?
     
  11. Brogan

    Brogan XenForo Moderator Staff Member

    The same way.

    Template edits using a conditional statement to check for an avatar or gravatar.
     
    SneakyDave and Amaury like this.
  12. Adam Howard

    Adam Howard Well-Known Member

    WORKS ! (y)
    You seem to do just fine :)
     
  13. Adam Howard

    Adam Howard Well-Known Member

    There is A LOT of templates that will need to be edited in order to apply this system wide :eek:

    Would love to still see this as an option though
     
    semprot and Amaury like this.
  14. Amaury

    Amaury Well-Known Member

    Personally, I would go with two options:
    • Completely disable avatars site wide
    • Completely disable "no avatar" avatars site wide
     
    Gossamer and Adam Howard like this.
  15. Adam Howard

    Adam Howard Well-Known Member

    That's the desired preferred goal ;)
     
  16. Arantor

    Arantor Active Member

    I've personally often thought the lack of an avatar in the fashion suggested makes things look uneven.
     
    SneakyDave likes this.
  17. Adam Howard

    Adam Howard Well-Known Member

  18. Newt

    Newt Active Member

    Was looking to do the same and realized that for branding purposes, something like this would be even better. Just replace the default avatars.

    Just sayin' :D

    Sans-titre-2.png
     

Share This Page