"liveData" Macro

Last modified by Eleni Cojocariu on 2026/09/11 15:51

Reference

Description

Displays a list of entries fetched from a Live Data source, offering different layouts, pagination, entry selection, multi-property sorting, filtering and in-place editing.

The Macro is a block Macro: a Live Data always starts a new block.

Usage

Every parameter is optional. A call normally names the source the entries come from, its sourceParameters, and the properties to display:

{{liveData
  id="..."
  properties="..."
  source="..."
  sourceParameters="..."
  filters="..."
  sort="..."
  limit="..."
/}}

The Macro content may hold an advanced configuration, written as the JSON document described in Live Data Configuration. Where a parameter and that JSON set the same thing, the parameter wins.

Parameters

NameMandatoryAllowed ValuesDefault ValueDescription
idNoAny name unique in the pageN/AThe id of the instance. Its display state is stored in the page URL under this id, so two instances in the same page must not share it.
propertiesNoA comma-separated list of property idsEvery property the source declaresThe properties to fetch and display, in display order.
sourceNoThe hint of a Live Data sourceN/AThe source providing the entries, specified as a component hint. Without it the entries come from the in-line data in the Macro content.
sourceParametersNoA URL query stringN/AThe parameters of the source. These are listed for specific sources in Live Data Sources.
filtersNoA URL query string of property=value pairsN/AThe filters applied initially. Repeat a property to filter on several values.
sortNoProperty ids, each optionally suffixed with :asc or :descN/AThe properties to sort on initially, in order of precedence.
limitNoA positive number15The number of entries per page. Query limits cap it at 1000 by default.
offsetNoA positive number0The index of the first entry to show.
layoutsNoA comma-separated list of layout idstable,cardsThe layouts the reader may choose from. The first of the list is displayed initially.
showPageSizeDropdownNotrue or falsefalseWhether the reader can change the number of entries per page through a drop-down.
pageSizesNoA comma-separated list of numbers15,25,50,100The values offered in that drop-down.
descriptionNoAny textN/AXWiki 16.0.0+ A description of the Live Data. It is displayed above the entries and is announced by assistive technologies as the description of the whole instance.

Examples

Displaying the Pages Most Recently Changed in a Location

{{liveData
  id="recentPages"
  properties="doc.title,doc.location,doc.author,doc.date"
  source="liveTable"
  sourceParameters="translationPrefix=platform.index."
  filters="doc.location=help"
  sort="doc.date:desc"
  limit="5"
/}}

Listing the Users of the Wiki

{{liveData
  id="users"
  properties="_avatar,doc.name,first_name,last_name"
  source="liveTable"
  sourceParameters="className=XWiki.XWikiUsers&translationPrefix=xe.userdirectory."
/}}

Restricting the Entries with an Initial Filter

{{liveData
  id="users"
  properties="_avatar,doc.name,first_name,last_name"
  source="liveTable"
  sourceParameters="className=XWiki.XWikiUsers&translationPrefix=xe.userdirectory.&last_name=Doe"
/}}

Filtering on Several Values of One Property

The tags property is filtered on two values and hidden, listing the pages tagged aaa or bbb without a tag column.

{{liveData
  id="documents"
  properties="doc.title,doc.date,doc.author,_actions,tags"
  source="liveTable"
  filters="tags=aaa&tags=bbb"
  sourceParameters="className=XWiki.TagClass&translationPrefix=platform.index."
}}{
  "meta": {
    "propertyDescriptors": [
      {
        "id": "tags",
        "visible": false
      }
    ]
  }
}{{/liveData}}

Taking the Entries from a Custom Results Page

{{liveData
  id="wikis"
  properties="wikiprettyname,description,owner,doc.creationDate"
  source="liveTable"
  sourceParameters="resultPage=WikiManager.WikisLiveTableResults&className=XWiki.XWikiServerClass&translationPrefix=platform.wiki.browse."
/}}

Taking the Entries from a Velocity Template

{{liveData
  id="groups"
  properties="name,members"
  source="liveTable"
  sourceParameters="template=getgroups.vm&translationPrefix=xe.admin.groups."
/}}

Choosing the Displayer of One Property

The actions property holds HTML and should be neither sortable nor filterable.

{{liveData
  id="logging"
  properties="logger,level,actions"
  source="liveTable"
  sourceParameters="resultPage=XWiki.LoggingAdminTableJson&translationPrefix=logging.admin.livetable."
}}{
  "meta": {
    "propertyDescriptors": [
      {
        "id": "actions",
        "displayer": "html",
        "sortable": false,
        "filterable": false
      }
    ]
  }
}{{/liveData}}

FAQ

Can the Macro be used inside a sentence?

No, it is a block Macro and always starts a new block.

A parameter and the Macro content set the same thing. Which one applies?

The Macro parameter, as explained in Live Data Configuration.

What happens if I set no parameter at all?

A call with no parameter is still valid: without source the entries come from the Macro content, and without properties every property the source declares is displayed.

Why are fewer entries displayed than the limit I set?

Because query limits cap the number of entries a page may display, at 1000 by default.

Related

Get Connected