{expanding-reporter}
Plugin: Reporting Plugin, from version 3.0.0
This is a reporter which can expand on a items returned from another, contained reporter.
Description
This reporter will expand on a list of sub-items in the original report. See the examples for more information.
Usage
{expanding-reporter:prefix:key|as=alias}
{xxx-reporter}...{xxx-reporter}
{xxx-sort:...}
{xxx-filter:...}
{expanding-reporter}
Parameters
| Name | Required | Default | Description |
|---|---|---|---|
| [default]/key | | The key that will be retrieved from each item in the contained report. If it is a list, this reporter will return an Expanded result for each of the items in that list. If it is a single item, a single Expanded result will be returned. If it is empty, the result will depend on whether the 'requireValue' parameter is true or false. See 'requireValue' for details. | |
| as | | The name to set each expanded item as when accessing it in the report. May not be 'item', as this is reserved for the original item being expanded. | |
| matchAll | | true
| If set to 'false', content matching any of the criteria will be returned. Otherwise, the content must match all criteria. |
| allowEmpty | | false
| If set to true, the parent item will still be returned even if the specified key value is empty. |
| Note This macro replaces the expand-on macro present prior to Reporting 3.0.0 |
Below is an example of converting from expand-on to expanding-reporter. It is a simple report which will output the children of the current page who have comments, as well as the the first 50 characters of each comment, in reverse date order.
Using expand-on
{report-table}
{local-reporter:content:children}
{text-sort:content:title}
{expand-on:content:all comments|as=comment}
{date-sort:content:creation date|order=descending}
{expand-on}
{local-reporter}
{report-column:title=Page}{report-info:expanded:item > content:title|link=true}{report-column}
{report-column:title=Comment Summary}{report-info:expanded:comment > content:body > text:first 50|render=wiki}{report-column}
{report-table}
Using expanding-reporter
{report-table}
{expanding-reporter:content:all comments|as=comment}
{local-reporter:content:children}
{text-sort:comment:page > content:title}
{date-sort:content:creation date|order=descending}
{expanding-reporter}
{report-column:title=Page}{report-info:expanded:item > content:title|link=true}{report-column}
{report-column:title=Comment Summary}{report-info:expanded:comment > content:body > text:first 50|render=wiki}{report-column}
{report-table}
Things to note
- expanding-reporter is around the original report, not inside it.
- The text-sort was moved into the expanding-reporter. The reason for this is that expanding does its own sorting on the whole result set. In this case, it makes more sense to group comments by the parent page first, then by their creation date. In other places, you may not want to do that.
- The 'expanded:item' and 'expanded:comment' keys are exactly the same as before. The expanding-reporter outputs the same structure as expand-on.

Discussions