0

I am trying to show a default avatar if the member hasnt uploaded a custom avatar.

Here is my code:

{exp:friends:mine reciprocal="y" orderby="screen_name" sort="asc" limit="5" member_group_id="6" member_id="{segment_3}" dynamic="no"}
<li class="network">
  {if friends_avatar_url}
  <a href="{path='volunteers/profile'}/{member_id}/">
    {exp:ce_img:single src="{friends_avatar_url}" width="50" height="50" }
    {friends_screen_name}
  </a>
  {if:else}                  
  <a href="{path='volunteers/profile'}/{member_id}/">
    <img src="{site_url}images/avatars/default_set/default-member-ph.png" width="50" height="50">
    {friends_screen_name}
  </a>
  {/if}
</li>

{if friends_no_results}
<li class="noresults">No Volunteers</li>
{/if}{/exp:friends:mine}

Is there a reason why the conditional wouldn't work?

6
  • Seems to work in my testing. What version of Friends and EE are you using? Have you tested the above on a completely, absolutely blank EE template with nothing whatsoever on it besides the code?
    – Solspace
    Feb 3, 2014 at 21:53
  • yes tested on blank template with just code with no results. if they have avatar it shows but default doesnt. i am using EE 2.7.2 and Friends 1.6.3
    – Tad Ward
    Feb 4, 2014 at 15:31
  • When there is no avatar, does the friends_screen_name display at least? If so, maybe your img path is just wrong?
    – Solspace
    Feb 4, 2014 at 22:41
  • yes the friends_screen_name does show and the image path is correct.
    – Tad Ward
    Feb 5, 2014 at 15:01
  • no other ideas @Solspace ?
    – Tad Ward
    Feb 7, 2014 at 20:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.