Documents Macro

Last modified by Vincent Massol on 2025/06/23 10:35

cogDisplays list of documents in a Livetable
TypeXAR
CategoryMacro
Developed by

XWiki Development Team

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Standard

Compatibility

Since XWiki 3.5M1

Description

Displays a list of documents in a Live Data.

Information

This macro is part of the Index Application.

Usage

{{documents id="<id>" count="<count>" actions="<true|false>" space="<space>" parent="<parent>" columns="<columns>" location="<location>"/}}

Parameter definitions

NameOptionalAllowed valuesDefault valueDescription
idyesRandom idThe internal Live Data id (the HTML id). This can be used for styling the table for example.
countyes15The number of items to display by default.
actionsyestrue/falsetrue Whether to show the actions columns or not if the user has the permissions
columnsyesdoc.title,doc.location,doc.date,doc.authorIf specified, only display specified columns (e.g. doc.name,doc.author). See the Livetable documentation for the list of available columns.
locationyesN/AIf specified, only display documents having a part of their full reference matching the passed location. For example a location value of par would match a document with a reference of France.Paris.SomePage. Also note that the / character is accepted as a reference separator (in addition to .).
filtersyesN/AXWiki 17.4.0+, 16.10.9+ If specified, the provided filters is used as the default filter for the Live Data. Those filters are directly passed to the Live Data macro filters parameter. Note that the viewer of the Live Data see the filters and can change them.
spaceErrorDeprecatedyesN/AIf specified, only lists documents found in the passed space (by default all documents are listed). The full space reference must be passed. For example to list a document located in the Space1.Space2 space you'd need to use space="Space1.Space2 (simply using Space2 wouldn't work). Doesn't work with Nested Pages, use the location parameter instead.
parentErrorDeprecatedyesN/AIf specified, only list pages having the specified parent (by default all documents are listed). Doesn't work with Nested Pages, use the location parameter instead.

Example 1

Display all pages having Drafts. as part of their references.

{{documents location="Drafts."/}}

Results in:

documentsmacro-location.png

Example 2

Display all pages having Drafts. as part of their references, and filtered by 

{{documents location="Drafts." filters="doc.author=Admin"/}}

Notice how the "Last Author" column is pre-filled with a filter on the Administrator, but can still be changed.

documentsmacro-filters.png

Get Connected