Confluence User Cloud Macro

This user macro will display users in a specific group in a cloud-like format, as shown below.

## Macro Name: user-cloud
## Macro title: User Cloud
## Description: Displays a list of users in a cloud-like format
## Category: Confluence content
## Body processing: Unrendered

## @param Group:title=Group|type=string|required=true|desc=Group name
## @param MinWidth:title=Minimum Width|type=string|required=true|desc=Minimum width in CSS units (e.g. px)|default=120px
## @param PicSize:title=Picture Size|type=string|required=true|desc=Picture height in CSS units (e.g. px)|default=60px
## @param Border:title=Border Colour|type=string|required=false|desc=Border Colour
## @param Fill:title=Fill Colour|type=string|required=false|desc=Fill Colour

#foreach($user in $userAccessor.getMembers($userAccessor.getGroup($paramGroup)))
  <span style="background: $paramFill; min-width: $paramMinWidth; text-align: center; display: inline-block; border: 1px solid $paramBorder; padding: 6px; margin: 8px; border-radius: 4px">
    <img style="height: $paramPicSize; border-radius: 3px" src="$userAccessor.getUserProfilePicture($user).getUriReference()"><br/>
    <a href="/display/~$user.getName()">$user.getFullName()</a>
  </span>
#end

The layout can be customized for border, background, minimum width of block, and picture height; each item is a span which will flow depending on the width which in turn depends on the specified minimum and the name length.

Names are links to the user’s profile page.

The image below can be used as the icon.

Leave a Reply

Your email address will not be published. Required fields are marked *