Exhibit/Formats

Exhibit Reference Home &raquo;

You can modify the ways values of various value types (date, url, image, etc.) are rendered by adding an ex:formats attribute to any element that has ex:role. The content of an ex:formats attribute looks a bit like a list of CSS rules, e.g.,

<div ex:formats="date { mode: medium; show: date } number { decimal-digits: 2 } item { title: expression(concat(.label, ': ', .gender)) }" ...

which looks easier to read if you spread it vertically like in CSS

date { mode: medium; show: date } number { decimal-digits: 2 } item { title: expression(concat(.label, ': ', .gender)) }

In the example above, there are 3 rules applied to 3 value types: date, number, and item. Each rule consists of zero or more settings. A setting consists of the setting's name, a colon, and then some specifications. Settings are separated by semicolons, much like in CSS.

This now works in lens templates, but not in facets.

Reference
To specify a URL, wrap it with

url(...)

To specify an expression, wrap it with

expression(...)

To specify a string, wrap it with single or double quotation marks.

date

 * : number in unit of hours.
 * :  |   |   |  ; will nullify subsequent   specifications.
 * : string; will nullify subsequent  specifications. E.g., 'dd/MM/yyyy h:mm a'


 * :  |   |   (default is  )

number

 * : non-negative integer |  or   (to mean no specific limit)

text

 * : positive integer greater than 3 |  or   (to mean no specific limit)

image

 * : expression evaluated against current item | string
 * : positive integer |  or   (to mean no specific limit) not yet implemented
 * : positive integer |  or   (to mean no specific limit) not yet implemented

url

 * : string |
 * : url |  not yet implemented

item

 * : expression |  (for the default rendering using the label property)

currency

 * : [  |   |   |   |   |   ]+
 * : string |  (for the locale's default symbol) |   (for no symbol)
 * : non-negative integer |  or   (to mean no specific limit)
 * : non-negative integer |  or   (to mean no specific limit)

list

 * : string
 * : string
 * : string

The defaults for these settings are dependent on the locale. For English,  is ", ",   is ", and ", and   is " and ".