cogCustom displayer for User properties
Developed by

Vincent Massol

Rating
Rate!
0 Votes
LicenseGNU Lesser General Public License 2.1

Description

While waiting for Closed XWIKI-4022 to get implemented here's how you could have a nicer User property display.

Edit your List of Users property class field using the Class Editor and in the Custom Display field, type:

{{velocity}}
#set ($propertyClass = $object.getxWikiClass().get($name))
#if ($type == 'edit')
 {{html clean=false}}
    $doc.displayEdit($propertyClass, $prefix, $object).replaceAll("value='[^']*+' size=", "value='$!{valueString}' size=")
 {{/html}}
#else
  #foreach($v in $value.split(','))
    [[{{useravatar username="$v" height="40"/}}>>$v]]  #end
#end
{{/velocity}}

Example

When you edit your page in inline mode you'll see for example:

usercustomdisplay1.png

And if you use a Livetable with a column displaying a List of Users you'll get:

usercustomdisplay2.png

Prerequisites & Installation Instructions

Copy the code snippet to a page and save it.

Tags:
Created by Vincent Massol on 2012/06/11 16:08
     

Get Connected