This component will display a users' avatar.
If the user hasn't uploaded an avatar to Newzulu Platform, the most appropriate avatar will be picked based on the user's registration type, gender and other criteria.
Avatars are chosen in this order:
<fm:UserAvatar uid="1" width="50" />
In this example, the avatar for user with ID '1' will be returned as HTML with a width attribute: <img src="/static/1/images/global/male11.png" width="50" alt="Firsty McLastname"/>
Name | Required | Default | Description |
---|---|---|---|
femaleDefault | Optional | Relative link to the default female image you would like to show if the user has not specified any | |
height | Optional | Either the width or the height in pixels is required. Must be at least 1. | |
maleDefault | Optional | Relative link to the default male image you would like to show if the user has not specified any | |
neutralDefault | Optional | Relative link to the default neutral image you would like to show if the user has not specified any | |
uid | Required | The user's id | |
var | Optional | Using this attribute allows you to assign the Avatar path in a template variable, as opposed to displaying the Avatar itself. Please refer to Example 5 to see how to use this functionality. | |
width | Required | Either the width or the height in pixels is required. Must be at least 1. |
This component defines no template variables.
This displays bunch of user avatars in a list, defaulting to gender images uploaded to Newzulu Platform. The avatars will link to their profile page.
<fm:UserList fields="id">
<fm:Loop>
<a href="/profile/{$$user.id}">
<fm:UserAvatar uid="{$$user.id}" width="50" neutralDefault="1365467" maleDefault="1365468" femaleDefault="1365469" />
</a>
<br />
</fm:Loop>
</fm:UserList>
This displays a users avatar that will maintain aspect ratio but will be a maximum of 200px in height. If the user doesn't have an avatar specified, isn't logged in with Facebook and doesn't have a Gravatar account, the Newzulu Platform gender defaults are used.
<fm:UserAvatar uid="{$$user.id}" height="200" />
This displays an avatar with constrained proportions as to always return a square image.
<fm:UserAvatar uid="{$$user.id}" width="100" height="100" />