This page is a snippet

For full information, see:

Snippet

 

Macro name: contentbylabel

Macro body: None.

Parameter nameRequiredDefaultParameter description and accepted values
spacesNo@all

Filters the results by space. The macro will display only the pages and other content types which belong to the space(s) you specify here.

You can specify one or more space keys, separated by a comma or a space.

  • To exclude content in a specific space, put a minus sign (-) immediately in front of that space key. For example: If you specify a space key of -BADSPACE you will get only content which is not in the BADSPACE.
  • To indicate that the results must come from a specific space, put a plus sign (+) immediately in front of that space key. For example: If you specify a space key of +GOODSPACE you will get only content in GOODSPACE. (Note that this is not particularly useful, because each content item belongs to one space only. If you put a plus sign next to one space key and list other space keys too, the other space keys will be ignored.)

Special values:

  • @self — The current space.
  • @personal — All personal spaces.
  • @global — All global spaces.
  • @favorite — The spaces you have marked as favourite.
  • @favourite — The same as @favorite above.
  • @all — All spaces in your Confluence site.
  • * — The same as @all above.

When specifying a personal space, remember to use the tilde (~) sign in front of the username, such as ~jbloggs or ~jbloggs@example.com.

authorNo(None)

Filters the results by author. The macro will display only the pages and other content types which are written or updated by the author(s) you specify here.

You can specify one or more authors, separated by a comma.

titleNo(None)Adds a heading to the list.
showLabelsNotrueDetermines whether to display the matching labels in the list of results.
reverseNofalseUse this parameter in conjunction with the sort parameter. Set reverse=true to change the sort from ascending to descending. This parameter is ignored if the sort parameter is not specified.
sortNomodifiedDetermines how the results are sorted. To change the sort order from ascending to descending, use the reverse parameter described above.

If this parameter is not specified, the sort order defaults to descending order based on the last modification date.

Values:
  • title — Sort alphabetically by title.
  • creation — Sort by the date on which the content was added.
  • modified — Sort by the date on which the content was last updated.
maxNo15Determines the maximum number of results to be displayed. Note that the results are sorted first, and then the maximum parameter is applied.
excerptNofalseIf this parameter is set to true, the macro displays an excerpt from each page listed in the results. Note that you must define the excerpts on each of those pages, by adding the Excerpt macro to each page. If a particular page does not have an excerpt defined, then the Content by Label macro will not attempt to show an excerpt for that page. The Content by Label macro will show only the first few lines of the excerpt for each page.
labelsYes(None)Use this parameter to filter the results by label. The macro will display only the pages and other content types which are tagged with the label(s) you specify here. See also the operator parameter.

You can specify one or more label values, separated by a comma or a space.
  • To exclude content which matches a given label, put a minus sign (-) immediately in front of that label value. For example: If you specify a label value of -badpage you will get only content which is not labelled with 'badpage'.
  • To indicate that the results must match a given label value, put a plus sign (+) immediately in front of that label value. For example: If you specify a label value of +superpage,+goodpage you will get only content which has at least two labels, being 'superpage' and 'goodpage'.
showSpaceNotrueDetermines whether to display the spaces in the list of results.
typeNoAllFilters the restults by content type. The macro will display only the content of the type you specify here.

You can specify one or more types, separated by a comma or a space.

To exclude content of a given content type, put a minus sign (-) immediately in front of that content type. For example: If you specify a content type of -blogpost you will get pages and all other content except for blog posts.

Available values:

  • pageages.
  • blogpost or newsblog posts, also known as news items.
  • attachment – attachments.
operatorNoORThe operator to apply to the supplied lists of labels. By default, a page with any of the non-prefixed labels (that is, labels without a plus (+) or minus (-) sign immediately preceding it) will be listed. If you specify a value of AND, only pages with all of the supplied non-prefixed labels will be listed.

Note that this parameter only modifies the behaviour of the 'Label(s)' parameter and only affects label values without a plus (+) or minus (-) sign prefix. To avoid confusion or unexpected results, we recommend that you do not use the operator parameter in conjunction with any label values prefixed with '+' or '-' signs.
  • No labels