Overview
Retrieving and displaying metadata values from a single page using the metadata-from
macro and metadata-values
macro
Retrieving and displaying a single piece of metadata 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. 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 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 value of the metadata Division has been defined using the Comala Metadata On the page, the metadata value is retrieved using the In this example, the display would simply be the value of the metadata Division filtered to be from the page Project initiation Document.@self
to Insert the macro.metadata
macro.metadata-from
macro.
Retrieving and displaying multiple pieces of metadata from a page
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: 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. 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 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.Customizing the metadata-report macro to select pages for the report
@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.
Additionally you can use the {metadata-values} macro to retrieve and display a simple list of metadata and their values from a single page.