Zuletzt geändert von xwikiadmin am 2025/01/07 12:27

Zeige letzte Bearbeiter
1 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.
2
3 = Parameters =
4
5 |=Parameter|=Description|=Required|=Default
6 |**labels**|A 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)
7 |**operator**|Whether all the tags should match (AND), or any (OR). This value is ignored if the cql parameter is set.|No|(((
8 OR
9 )))
10 |**max**|Maximum number of results|No|(unset)
11 |**sort**|What 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)
12 |**reverse**|Whether to reverse the sort (true) or not (false).|No|false
13 |**spaces**|Confluence 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)
14 |**title**|A title to display before the results|No|(empty)
15 |**cql**|A query written in the Confluence Query Language (CQL) syntax defining the list of documents to show. [[See the documentation>>https://extensions.xwiki.org/xwiki/bin/view/Extension/CQL/#HSyntax]].|If labels is not given.|(empty)
16 |**showSpaces**|Whether to display the Confluence space in which the documents are (true) or not (false).|No|true
17 |**showLabels**|Whether to display the tags of the documents (true) or not (false).|No|true
18 |**type**|What Confluence type of objects to show. This value is ignored if the cql parameter is set. Only known value: page.|No|(empty)
19 |**excerpt**|**This parameter is ignored.** Whether to show excerpts of documents (true) or not (false).|No|false
20 |**excerptType**|**This parameter is ignored.** Whether to show "##simple##" excerpts or "##rich content##" excerpt.|No|(unset)
21
22 = Example Usage =
23
24 {{code}}
25 {{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"/}}
26 {{/code}}
27
28 Result:
29
30 {{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"/}}