Confluence User Cloud Macro

No Comments

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

user-cloud-example.png

## 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.

user-cloud.png

Leave a comment

(you must confirm your comment on the next page)

other sites


like it?

Feed Delicious Reddit