Macro "Metadata Overview" (v 2.0)
- Almuth Boehme [Communardo]
- Sandro Herrmann (Deactivated)
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.
In order to insert any of the macros, you need to possess editor permissions for the page.
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)
SINCE VERSION 2.0 SINCE 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 (v 2.0) and the next section.
Image 2: Adding Filters to Metadata Overview Macro (click to enlarge)
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 Lucene search. Find detailed instructions on how to generate these queries in Searching with Metadata (v 2.0) 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 for the Metadata Overview macro in the next section.
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".
Parameter | Default | Description | |
---|---|---|---|
Filters | None | Optional | Define 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 | None | Optional | 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 Lycene 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:
|
Metadata fields filter | None | Optional | 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. Use this paramter to change the order of the columns. Only the title column will always be displayed as first column. |
Show space key | Unchecked | Optional | Display the space key for each page. |
Show hidden metadata fields | Unchecked | Optional | Display hidden metadata fields as well. |
Common metadata to display (Author, Last Modifier,...) | None | Optional | If you tick a checkbox, the respective metadata value will appear as a row in the overview. Available boxes:
|
Sort by column | Page title ("title") | Optional | Defines the metadata field whose values will determine the sort order of all entries. |
Sort direction | ASCENDING | Optional | Defines the sort direction of the table entries according to the values entered in the "Sort by column" column. |
Number of items to display | 20 | Optional | 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. |
Title column heading | None ("Title") | Optional | Change the heading of the "Title" column. |
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".
CSV Export
SINCE VERSION 1.2
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"):
metadataset:metadataset.democaseproductinfo AND spacekey:DEMOCASEPRODDIR
2) Personalization of Confluence content with the help of User Profiles for Confluence - 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 "Technology" of the current user:
metadataset:metadataset.productinfo AND metadatafield.technology:upc.currentUser.Technology
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 (v 2.0).