"displayChanges" Macro

Last modified by Vincent Massol on 2026/08/28 22:09

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

NameMandatoryAllowed ValuesDefault ValueDescription
contextVariableYesA Velocity variable nameN/AThe variable holding the change page references to render
displayerNogrid, simple, list, flow, or the name of a displayer of your owngridThe layout to render with; see Change Displayers
columnsNoA number2How many columns to lay the changes out in. Only the grid displayer uses it
displayEditLinkNotrue or falsefalsetrue 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.

Related

Get Connected