Adding Metadata to the Template
By default, the Help Center template automatically includes metadata in the generated export. Using the Template customization functionality you can expose this metadata in the export output (ie. page view). This page outlines the steps need to achieve this.
Viewing Metadata
The easiest way to check for available metadata is to:
Generate an export with Scroll HTML Exporter
Unzip the *.zip export file
Open a HTML file (not the index or a redirect file) with a text editor
After this, the metadata will be visible:
Available Metadata
The type of content being exported from Confluence will determine the type of metadata that is included in the export. For instance, exports that includes content from Scroll Documents or Scroll Versions will contain additional metadata (related to these apps).
Metadata in all Exports
Metadata Name | Description |
---|---|
| Provides date / time when the export was generated |
| Provides PageID for the page |
| Provides page title for the page |
| Provides revision of the page (as per Confluence Page History) |
| Provides a unique ID within the document scope in Scroll Versions or Scroll Documents.
|
| Provides creation date / time for the page |
| Provides last modified date / time for the page |
| Provides the Confluence page labels present on the page |
| If defined, provides the Page Key(s) (Scroll Versions) or Context key(s) (Scroll Documents) |
| Provides the Confluence space key where the page was exported from |
| Provides the Confluence space name where the page was exported from |
Additional Metadata
Metadata Name | Description |
---|---|
| Provides the ID for the exported Scroll Documents |
| Provides the title for the exported Scroll Documents |
| Provides the ID for the exported Scroll Documents version, or exported version from Scroll Versions |
| Provides the name for the exported Scroll Documents version, or exported version from Scroll Versions |
| Provides the description for the exported Scroll Documents version, or exported version from Scroll Versions |
| Provides the creation date of the exported Scroll Documents version, or exported version from Scroll Versions |
| Provides the status of the exported Scroll Documents version |
| Provides the ID of the exported Scroll Documents Variant (requires Variants for Scroll Documents), or exported variant from Scroll Versions |
| Provides the name of the exported Scroll Documents Variant (requires Variants for Scroll Documents), or exported variant from Scroll Versions |
| Provides the description of the exported Scroll Documents Variant (requires Variants for Scroll Documents), or exported variant from Scroll Versions |
| Provides the language code of the exported Scroll Documents translation (requires Translations for Scroll Documents), or exported translation from Scroll Translations |
| Provides the language name of the exported Scroll Documents translation (requires Translations for Scroll Documents), or exported translation from Scroll Translations |
Adding the Metadata in the Exported Page View
In order to add metadata to your generated export output, it will require using custom JavaScript via the Template Customization functionality. Depending on your requirement, you can add the available metadata as required.
The following example adds the exp-space-key
to the header text in the export. You can simply change the metadata name (line 3) in order to display a different metadata value:
// Set the header text in the exported document to the space name instead of the root page title
document.addEventListener('DOMContentLoaded', function() {
const spaceName = document.querySelector('meta[name="exp-space-key"]').content;
document.querySelector('.document-title a').innerText = spaceName;
});