"displayChanges" Macro
Last modified by Vincent Massol on 2026/08/31 18:05
Reference
Description
Renders the change pages that the getChanges macro collected into a Velocity variable, in one of the layouts described in Change Displayers.
Querying and rendering are deliberately two macros rather than one: between the two calls you still hold a plain Velocity list, so you can drop, sort or slice the changes before they are rendered.
Usage
{{displayChanges contextVariable="changeDocs" displayer="grid" columns="2" displayEditLink="false"/}}Parameters
| Name | Mandatory | Allowed Values | Default Value | Description |
|---|---|---|---|---|
| contextVariable | Yes | A Velocity variable name | N/A | The variable holding the change page references to render |
| displayer | No | grid, simple, list, flow, or the name of a displayer of your own | grid | The layout to render with; see Change Displayers. Release Notes Application 2.4+ A value that is not a plain name (letters, digits, - and _) falls back to grid. |
| columns | No | A number | 2 | How many columns to lay the changes out in. Only the grid displayer uses it. Release Notes Application 2.5+ A narrow screen lowers the count, to two below 992px and to one below 768px, and never raises it |
| displayEditLink | No | true or false | false | true adds a pencil next to each change, linking to its editor |
Examples
Example 1: Render a query in three columns
{{getChanges products="XWiki" versions="12.%" contextVariable="changeDocs"/}}
{{displayChanges displayer="grid" columns="3" contextVariable="changeDocs"/}}Example 2: Filter the list between the two macros
{{getChanges products="XWiki" versions="12.%" contextVariable="allChanges"/}}
{{velocity}}
#set ($changeDocs = [])
#foreach ($changeDoc in $allChanges)
#if (!$changeDoc.contains('Entry001'))
#set ($discard = $changeDocs.add($changeDoc))
#end
#end
{{/velocity}}
{{displayChanges displayer="list" contextVariable="changeDocs"/}}FAQ
How do I add a layout of my own?
Create a displayer page and pass its name to displayer; see Create a Change Displayer.