The Contentbylabel macro lists content which has been tagged with specific labels.

On this page:

Usage

What you need to type

What you will get

{contentbylabel:documentation, my:stuff}

Error rendering macro 'contentbylabel'

Invalid label: "my::stuff"



By default, Confluence lists all the labels for each result displayed. See the optional parameters below to change this behaviour.

Recommended Default Usage

To display all pages with the label needs-fixing, use:

{contentbylabel:needs-fixing|showLabels=false|maxResults=99|showSpace=false|key=@self}


Optional Parameters

No 

Parameter

Default

Description

 1

key

all

Specify a space key to show the results for a particular space.
Keywords: @all shows results from all spaces; @self shows results from only the current space.

 2

type

false

Filter by content type

 3

showLabels

true

Show or hide labels for results

 4

showSpace

true

Show or hide spaces for results

 5

excerpt

false

Show or hide excerpts for results

 6

maxResults

5

Specify maximum results to display

 7

sort=creation
sort=title
sort=modified

recent

The 'sort' attribute is an optional attribute that allows you to configure how the children are sorted. You can also use the 'reverse' parameter (see below) to optionally reverse the sorting.

 8

reverse=true

false

If you are using the 'sort' parameter (see above), you can also use the 'reverse' parameter change the sort order.

 9

operator

OR

The operator to apply to the supplied lists of labels. By default, a page with any of the labels will be listed. By using operator=AND, only pages with all of the supplied labels will be listed.

Examples

1. Filter by space

{contentbylabel:dogs,cats|key=PETS}

2. Show only results in current space

{contentbylabel:dogs,cats|key=@self}

3. Show results from all spaces

{contentbylabel:dogs,cats|key=@all}

4. Filter by content type: pages or blog posts

{contentbylabel:dogs,cats|type=page,blogpost}

5. Hide labels for results

{contentbylabel:dogs,cats|showLabels=false}

6. Hide spaces for results

{contentbylabel:dogs,cats|showSpace=false}

7. Display excerpts for results

{contentbylabel:dogs,cats|excerpt=true}

8. Specify the maximum number of results to display

{contentbylabel:dogs,cats|maxResults=99}

9. Sort by creation date, modification date or title

{contentbylabel:dogs,cats|sort=title}

10. Change the sort order

{contentbylabel:dogs,cats|sort=title|reverse=true}
RELATED TOPICS

Related Labels Macro
Navmap Macro
Recently Used Labels Macro
Working with Labels Overview
Working with Macros

Take me back to Confluence User Guide