User Avatar Macro

Last modified by Thomas Mortagne on 2014/08/26 13:44

cogDisplays the avatar of a user, or a standard image noavatar.png if the user has no avatar
TypeJAR
Developed by

XWiki Development Team

Rating
Rate!
0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Enterprise, XWiki Enterprise Manager

Description

Displays the avatar of a user, or a standard image noavatar.png if the user has no avatar. A user's avatar is a url that is defined by editing a user's profile.

Usage

{{useravatar username="<username>" /}}

Parameters definition

NameOptionalAllowed valuesDefault valueDescription
usernamenoa stringnoneXWiki user of the form "wiki:XWiki.UserName". Note that the wiki part is optional and should be used when using XWiki in multiwiki mode and you wish to reference a user located in another subwiki. Starting with XWiki 3.2 it's now possible to pass just the shortname (i.e. username without the "XWiki." space prefix).
widthyesan integerimage's natural widthThe width of the avatar image
heightyesan integerimage's natural widthThe width of the avatar image

Example

The avatar of some XWiki.JohnDoe user:

{{useravatar username="XWiki.JohnDoe" width="40" height="40"/}}

The avatar of some XWiki.JohnDoe user located in a subwiki named somewiki:

{{useravatar username="somewiki:XWiki.JohnDoe" width="40" height="40"/}}

Result

noavatar.png

Known Issues

  • In XWiki < 4.01 or 4.1-rc-1, there was a bug where referencing users located in subwikis was not working.
Tags: users image
Created by dan on 2009/03/20 14:33
    

Get Connected