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.
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)
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 3.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 3.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 in the next section.
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".
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 (CQL)
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).
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 metadata links to the current page
The current user object by using the placeholder $user
Example: Show all pages with the current logged in user defnined in a metadata field
The value of a certain field of the user's profile by using the placeholder upc.currentUser.<FIELDNAME>. This parameter works for all field types except multiselect and the About me field. The add-on User Profiles for Confluence needs to be installed.
Metadata fields filter
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
Display the space key for each page.
Show hidden metadata fields
Display hidden metadata fields as well.
Common metadata to display (Author, Last Modifier,...)
If you tick a checkbox, the respective metadata value will appear as a row in the overview.
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
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 column
Page title ("title")
Defines the metadata field whose values will determine the sort order of all entries.
Defines the sort direction of the table entries according to the values entered in the "Sort by column" column.
Number of items to display
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.
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 heading
Change the heading of the "Title" column.
Show a filter header at the top of the Metadate 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 realtime search result refresh.
Use the "Filter fields" parameter to predefine permanent filters.
Depends on: "Show filter" parameter needs to be checked.
Choose predefined metadata fields for the filter. They will be displayed to all users.
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.
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"):
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:
For further explanations of this use case, please see How to Get Started. Available options for placeholders are described in the section Parameters above.