Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Note

In order to insert macros in Confluence, you need to possess editor permissions for the page.

Anchor
top
top
There are several macros you can use to display metadata in Confluence or to select pages on the basis of their metadata. This page will show you how to use the Metadata Overview macro.

Topics include:

Table of Contents
outlinetrue
excludeOther Versions|Introduction
stylenone

Introduction

The Metadata Overview macro is used to display the page metadata of multiple pages in a table according to a search criterion.

An example result can be seen in this preview:


Image 1: Metadata Overview Macro (click to enlarge)

StatuscolourGreentitlesince version 2.0 StatuscolourBluetitlesince confluence 5.9


The search criterion is defined by filtering for metadata fields and certain values of those fields or metadata sets. Details on using the CQL dropdown filters are described in Searching with Metadata and the next section.

Image 2: Adding Filters to Metadata Overview Macro (click to enlarge)

 


 

Excerpt

 If you want to search for more detailed information, open the expert filter criteria by clicking "Show". This will allow you to, among other things, filter for metadata sets, filter for Confluence spaces or create more complex search queries using CQL search. Find detailed instructions on how to generate these queries in Searching with Metadata and some additional information in the next section.
The Metadata Overview will then only show search results that match the expert filter criteria AND selected filters.

You can find more detailed information on the available parameters in the next section.

 

Best Practice to display many columns

  • Display a scroll bar on each Metadata overview by using sections:
    Each section has its own scroll bar. Add a single Metadata overview in one section, a scroll bar will be displayed at the end of every section / macro.
  • Display one scroll bar in a table form:
    Using Metadata overview in tables with several columns, one scroll bar will appear at the bottom of the table.

Parameters
Anchor
parameters
parameters

The following parameters are available for the Metadata Overview macro. To display all of the parameters in the Metadata Overview macro, click "Show" next to the heading "Options".

ParameterDefaultDescription
FiltersNoneOptionalDefine metadata fields and metadata field values, and metadata sets to filter results displayed in the metadata overview macro. Can be left empty if expert filter criteria is used (see next parameter).
Expert filter criteria (CQL)NoneOptional

Define more comprehensive filter queries to filter results displayed in the metadata overview macro. Can be left empty if Filters are used (see prior parameter).

Expert filter criteria are defined using the metadata sets and field keys and the CQL search syntax. Please also see Determining the key of a Metadata set or field.

Placeholders are supported to make the output of the macro more dynamic.

The following parameters are available:

  • The current page object by using the placeholder $content
    • It is basically the data object used internally by Confluence please see the API Documentation for full capabilities
    • Example: to show all content with a global Metadata field of type LINK which links to the current page

      Code Block
      global.metadatafield.linkfield = "PAGEID:$content.id"


      Expand
      titleOther dynamic variables available

      Include Page
      Dynamic variables (v 3.3)
      Dynamic variables (v 3.3)


Expert filter criteria (Lucene)

Status
colourYellow
titledeprecated

NoneOptional

Define more comprehensive filter queries to filter results displayed in the metadata overview macro. Can be left empty if Filters are used (see prior parameter).

Expert filter criteria are defined using the metadata sets and field keys and the Lucene search syntax. Please also see  Determining the Key of a Metadata Set/Field.

Placeholders are supported to make the output of the macro more dynamic.

The following parameters are available:

  • The current page object by using the placeholder $content
    • Example: to show all content with metadata links to the current page

      Code Block
      metadatafield.linkfield:$content.id


  • The current user object by using the placeholder $user
    • Example: Show all pages with the current logged in user defined in a metadata field

      Code Block
      metadatafield.userfield:$user.name



  • Expand
    titleOther dynamic variables available

    Include Page
    Dynamic variables (v 3.3)
    Dynamic variables (v 3.3)


Metadata fields filterNoneOptional

Define metadata fields to be displayed in the overview from a multiselect dropdown. If the filter is empty all metadata (except hidden fields) will be displayed.

(info) Use this parameter to change the order of the columns. Only the title column will always be displayed as first column.

Show space keyUncheckedOptionalDisplay the space key for each page.
Show hidden metadata fieldsUncheckedOptionalDisplay hidden metadata fields as well.
Common metadata to display (Author, Last Modifier,...)NoneOptional

If you tick a checkbox, the respective metadata value will appear as a row in the overview.

Available boxes:

  • Author - author of the page
  • Last Modifier - person who made the last modification
  • Created at - date of creation
  • Modified at - date of last modification
  • Excerpt - show the excerpt of a page if one is defined with the help of the Excerpt Macro

(warning) If you run into performance issues when displaying excerpts, please use the "number of items to display" option to reduce the amount of displayed pages

Sort by columnPage title ("title")OptionalDefines the metadata field whose values will determine the sort order of all entries.
Sort directionASCENDINGOptionalDefines the sort direction of the table entries according to the values entered in the "Sort by column" column.
Number of items to display20Optional

Defines the maximum amount of pages that are to be displayed as rows in the macro per page. If the overview contains more items, the output will be paged.

(info) The maximum supported number is 250 items. However the performance depends on the number of items as well as the number of columns. You can improve performance by reducing either number.

Title column headingNone ("Title")OptionalChange the heading of the "Title" column.

Show filter

Status
colourGreen
titlesince version 3.0

UncheckedOptional

Show a filter header at the top of the Metadata Overview macro so users can filter the shown results by adding temporary filters.

When adding several filters, only results matching all filter criteria will be shown.

All field types are available for filtering. Changing the filter values will result in real-time search result refresh.

Use the "Filter fields" parameter to predefine permanent filters.

Filter fields

Status
colourGreen
titlesince version 3.0

NoneOptional

Depends on: "Show filter" parameter needs to be checked.

Choose predefined metadata fields for the filter. They will be displayed to all users.

Permissions

Note

Pages will be found across all (permitted) spaces. This means that search results are not limited to the current space unless you filter for a space within the parameter "Expert filter criteria".

The search results are filtered according to the permissions of the logged-in user. This means that you will only see pages you are allowed to access in the Metadata Overview macro.


If the page or space is not otherwise restricted, pages that can be accessed anonymously will appear in the Overview macro for anonymous users.

CSV Export

Metadata can be exported as a CSV file. To export metadata, go to a Confluence page whose metadata you want to export and add the Metadata Overview macro to the page. The export option can be found as the following symbol under the Metadata Overview macro:

Image 3: CSV Export Symbol (click to enlarge)


The exported CSV file includes the content of all metadata fields that are displayed in the Metadata Overview macro. By using the macro option "Metadata fields filter" you can define which metadata fields should be displayed and, consequently, exported. The page title of each page is included in the export by default.

Paging of the Metadata Overview does not change the number of results. If you click the export symbol on the first of several pages, you will still export the complete table.

In the next section you will find some examples for the expert filter criteria in the Metadata Overview macro.

Use Cases for Expert Filter Criteria

1) Example from the Metadata demonstration space "Product Directory" - show all pages with the Metadata set "Product Info" (Metadata set key "democaseproductinfo"), which are part of the space "Product Directory" (space key "DEMOCASEPRODDIR"):

Code Block
metadataset = metadataset.democaseproductinfo AND space = DEMOCASEPRODDIR

2) Personalization of Confluence content with the help of upp - show an overview of all pages with the metadata set "Product Info" where the metadata field "Technology" equals the content of the user profile field "Responsible for technology" of the current user:

Code Block
metadataset = metadataset.productinfo AND DEMOCASEPRODDIR.metadatafield.technology = "upc.currentUser"

For further explanations of this use case, please see How to Get Started. Available options for placeholders are described in the section Parameters above.

You can find further details on basic and complex search queries as well as determining the correct field or set keys in Searching with Metadata.



Back to Top

Include Page
_Version Switch
_Version Switch