Confluence bridge for Content by label

Last modified by admin on 2024/10/04 17:40

 The contentbylabel macro is a bridge between Confluence and XWiki. It displays a list of documents given a list of tags or a complex query in the Confluence Query Language (CQL) syntax.

Parameters

ParameterDescriptionRequiredDefault
labelsA list of tags to use, separated by a comma or a space. This value is ignored if the cql parameter is set.If cql is not given(empty)
operatorWhether all the tags should match (AND), or any (OR). This value is ignored if the cql parameter is set.No

OR

maxMaximum number of resultsNo(unset)
sortWhat to sort on. The only supported values are "modified", "creation" and "title" for now. Ignored if an order by clause is present in the cql parameter.No(unset)
reverseWhether to reverse the sort (true) or not (false).Nofalse
spacesConfluence spaces in which to search. @self for the current space. @all for everywhere. This value is ignored if the cql parameter is set.No(empty)
titleA title to display before the resultsNo(empty)
cqlA query written in the Confluence Query Language (CQL) syntax defining the list of documents to show. See the documentation.If labels is not given.(empty)
showSpacesWhether to display the Confluence space in which the documents are (true) or not (false).Notrue
showLabelsWhether to display the tags of the documents (true) or not (false).Notrue
typeWhat Confluence type of objects to show. This value is ignored if the cql parameter is set. Only known value: page.No(empty)
excerptThis parameter is ignored. Whether to show excerpts of documents (true) or not (false).Nofalse
excerptTypeThis parameter is ignored. Whether to show "simple" excerpts or "rich content" excerpt.No(unset)

Example Usage

{{confluence_contentbylabel cql="label = 'contentbylabelexample' and space = currentSpace()" showSpace="false" sort="title" title="This is the title of a contentbylabel macro" max="5" reverse="true" type="page" labels="contentbylabelexample" spaces="@self"/}}

Result:

This is the title of a contentbylabel macro