1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
    Dismiss Notice
  3. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Omit avatars when appropriate, change user info block

Discussion in 'Template Modifications [Archive]' started by Zak Smith, May 10, 2011.

  1. Zak Smith

    Zak Smith Member

    Here's the substance of a mod I did to do two things:

    1. Not litter the discussions with the generic avatars for users who haven't set one, and

    2. Change the order of the user title and avatar in the user info box so the user's name is at the top:


          <xen:hook name="message_user_info_text" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">                                                                  
                    <h3 class="userText">                                                                                                                                                 
                            <xen:username user="$user" itemprop="name" rich="true" />                                                                                                     
                            <xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user}</xen:contentcheck></em></xen:if>             
                            <!-- slot: message_user_info_text -->                                                                                                                         
    <xen:if is="{$user.avatar_width}>0 OR ({$isQuickReply} AND {$account.avatar_width}>0)">                                                                                               
            <xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">                                                                
                    <div class="avatarHolder">                                                                                                                                            
                            <xen:avatar user="$user" size="m" />                                                                                                                          
                            <!-- slot: message_user_info_avatar -->                                                                                                                       
    Looks like this

    Note that this also changes what is displayed at the bottom for the quick reply. This displays the user name/title AND the avatar if the user has an avatar, otherwise just the name/title.

    I wasn't sure if $visitor or $account was appropriate for the second check, but this does seem to work. ETA: $visitor works as well. I changed mine to use it.
  2. Vilandra

    Vilandra Active Member

    I could be wrong, but I was getting an error when trying to save this template, so I had to remove the "</xen:if>" from the last line there to get the template to save. Just in case anyone else has the same issue. Thanks for sharing this - looks a lot cleaner :)
  3. Zak Smith

    Zak Smith Member

    Not sure. If you open the if it needs to be closed somewhere... ?

    I've ported this mod up to the latest version and it still works fine.
  4. Digital Doctor

    Digital Doctor Well-Known Member

    The best of both worlds might be that it shows up empty for the person whom didn't choose an avatar.
    But ... for everyone else the blank avatar doesn't show up :)
  5. Zak Smith

    Zak Smith Member

    That's the point of this very minor mod.

Share This Page