Parent-Children Livetable macro

Last modified by Vincent Massol on 2024/07/05 18:14

cogDisplay a livetable containing one level of parent-children granularity
TypeXAR
Category
Developed by

Raluca Stavro, Mircea Staicu, Marius Dumitru Florea

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Compatibility

Version 1.2 doesn't work with Nested Pages. Also note that this macro requires Legacy Oldcore as it uses legacy APIs.

Installable with the Extension Manager

Description

Display a livetable containing one level of parent-children granularity, where parent is defined by a document in the given space that is not the space home page, has no parent or it's parent is the space home page.

Starting with XWiki 7.2, each non-terminal Page now supports displaying Children Pages through the children view (available from the Action Menu or by adding ?viewer=children to the URL).

Usage

Parameters

NameMandatoryDescription
spacenoSpace name to display the livetable for. The default value is the current space.
ordernoThe order to sort document titles by. The default value is asc.
rowCountnoSet the number of livetable rows. Default value is 10.  Since 1.2.

Examples

Simple usage

  {{parentschildrenlivetable space="XWiki" order="asc" rowCount="10"/}}

The parent-child hierarchy is displayed only on the ordering by the document title. Otherwise, the hierarchy is dropped, i.e. a normal livetable is displayed.
The parent is any document which has either an 'empty' parent or the WebHome page of the given space as a parent.

Results in:

parent-children-livetable-screenshot.png

The rows with a background color are highlighted in regards to the fact that those are documents which have no title set.

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

Release Notes

v1.2

Added rowCount parameter to set the number of rows for the livetable:
{{parentschildrenlivetable space="XWiki" order="asc" rowCount="30" /}}

v1.1

This is a bug fix version. Changed the way the JSON variable is constructed for documents with no title and how the js evaluates and treats those documents.

Get Connected