Overview

Metadata added to a page can easily be retrieved and applied on other pages, either as a individual metadata value or by selecting a range of metadata value names.

This means that for example, a single a page can be created for data entry as values for metadata names, and the values of each of the metadata names can be retrieved and used on a range of other pages.  Using metadata in this way avoids the continual repeated entry of data into tables across a space with the values simply being entered at a single point.

In reverse the metadata values from across a range of pages can be reported back to a single page to create a dashboard of information.


Retrieving a single metadata value from a page

To retrieve a single metadata value from a page, choose the Metadata from  macro from the Confluence macro browser:

The macro editor allows you to configure the macro.

metadata-from macro editor dialogue box options

The macro requires you to add both:

  • the metadata value name
  • the source page for the metadata name. If the metadata being retrieved is from the current page you need to add @self to Insert the macro.

The macro will retrieve the metadata value and display on the current page.

If the metadata includes any wiki formatting as part of the value then this will be rendered on the current page together with the value.

In the example the metadata Division value has been defined using the {metadata}  macro:

On the page, the metadata value is retrieved using the {metadata-from} macro:

In this example, the display would simply be the value.


Retrieving multiple metadata value from a page or group of pages

To retrieve multiple metadata values from a page or pages, choose the Metadata report macro from the Confluence macro browser:

The macro editor allows you to configure the macro before you Insert the macro to the page:

metadata report macro browser editor showing fields, space key and link options

The macro requires you to enter at least one metadata value name into Fields. Multiple metadata values can be retrieved by adding a comma separated list of metadata value names.

Adding the metadata value names and choosing to Insert the macro adds the macro placeholder to the page being edited.


This displays a table on the page of the metadata value names and their values from the child pages of the current page.

For example, the macro placeholder above would display the values for three pieces of metadata for each of the child pages:

The retrieved metadata values for the metadata are displayed in a separate row for each child page.

If the metadata value names are not found, or there is no value has added, the table will display the metadata value names specified in the macro but with no value(s) added. The columns are in order of listing of the metadata value names in the macro editor.

Additional options in the macro editor allow you to customise the macro.

Customizing the {metadata-report} macro to select pages for the report

The choice of source pages for the metadata report can be customized as follows:

  • Space key determines the space or spaces for the page metadata to be listed.
  • Content type - pages or blog posts
  • Root defaults to the current page and will report the metadata values on the child pages of the current page. 

You can choose the root to be parent page of the current page using @parent or the specify the name of a page for the root page. If these are added then the source for the metadata report will be limited to the metadata on the specified root page. 

To retrieve the metadata from a related group of pages to a specified root page, you must use the Pages option :


The Pages option can be used with the Labels option to select pages with a particular label from a group of related pages.

Related Comala Metadata macros


Related documentation