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

XF 1.3 Hide avatars for users without one

Discussion in 'Styling and Customization Questions' started by Warchamp7, Mar 14, 2014.

  1. Warchamp7

    Warchamp7 Active Member

    I'd like to hide the avatar block for any user without an avatar. How best can I go about this, since XenForo outputs the s, m or l sizes in the <img> tag for default avatars.
    DRE and CaptainMorgan like this.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You could try using a conditional statement in the template:

    <xen:if is="!{$visitor.avatar_date} AND !{$visitor.gravatar}">
    Content to remove here
    fly likes this.
  3. Warchamp7

    Warchamp7 Active Member

    Hmm, sound concept, but it hides all avatars, including people who have set one :/
  4. Warchamp7

    Warchamp7 Active Member

    Ah, silly me. Visitor isn't what I want in this case. Changed it to:

    <xen:if is="{$user.avatar_date} OR {$visitor.gravatar}">
    Hides the avatars in posts for users who don't have one. My initial post may not have been totally clear on the behaviour I wanted

Share This Page