Changes for page User Avatar Macro

Last modified by Marius Dumitru Florea on 2020/06/20 08:22

From version < 22.1 >
edited by Marius Dumitru Florea
on 2020/06/20 08:19
To version < 23.1
edited by Marius Dumitru Florea
on 2020/06/20 08:22
<
Change comment: There is no comment for this version

Summary

Details

ExtensionCode.ExtensionClass[0]
Show installed count
... ... @@ -1,0 +1,1 @@
1 +Yes
Description
... ... @@ -2,10 +2,18 @@
2 2  
3 3  == Usage ==
4 4  
5 +=== Wiki Syntax ===
6 +
5 5  {{code language="none"}}
6 6  {{useravatar username="<username>" /}}
7 7  {{/code}}
8 8  
11 +=== WYSIWYG Editor ===
12 +
13 +When inserting the User Avatar macro from the WYSIWYG editor you can select the user with the user picker.
14 +
15 +{{image reference="userAvatar-editMacro.png"/}}
16 +
9 9  === Parameters definition ===
10 10  
11 11  |=Name|=Optional|=Allowed values|=Default value|=Description
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

Wiki Syntax

{{useravatar username="" /}}

WYSIWYG Editor

When inserting the User Avatar macro from the WYSIWYG editor you can select the user with the user picker.

userAvatar-editMacro.png

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.

Get Connected