"displayChanges" Macro

Last modified by superadmin on 2026/11/25 21:26

Renders the changes that the getChanges macro collected into a Velocity variable, in one of the change displayer layouts.

Reference

Description

Querying, with the getChanges macro, and rendering, in one of the layouts of Change Displayers, 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. Release Notes Application 2.4+ A value that is not a plain name (letters, digits, - and _) falls back to grid.
columnsNoA number2How 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
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