Skip to main content
Skip table of contents

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:

  1. Generate an export with Scroll HTML Exporter

  2. Unzip the *.zip export file

  3. Open a HTML file (not the index or a redirect file) with a text editor

After this, the metadata will be visible:

Screenshot 2024-06-14 at 15.04.43.png

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

exp-export-timestamp

Provides date / time when the export was generated

exp-page-id

Provides PageID for the page

exp-page-title

Provides page title for the page

exp-page-version

Provides revision of the page (as per Confluence Page History)

exp-page-scroll-page-id

Provides a unique ID within the document scope in Scroll Versions or Scroll Documents.

  • This ID has the same value for the same page in all versions of a document.

  • If you publish a space with Scroll Versions into another space, then the copied pages will have their original page’s value of this ID.

exp-page-created

Provides creation date / time for the page

exp-page-last-modified

Provides last modified date / time for the page

exp-page-labels

Provides the Confluence page labels present on the page

exp-page-context-keys

If defined, provides the Page Key(s) (Scroll Versions) or Context key(s) (Scroll Documents)

exp-space-key

Provides the Confluence space key where the page was exported from

exp-space-title

Provides the Confluence space name where the page was exported from

Additional Metadata

Metadata Name

Description

exp-document-id

Provides the ID for the exported Scroll Documents

exp-document-title

Provides the title for the exported Scroll Documents

exp-version-id

Provides the ID for the exported Scroll Documents version, or exported version from Scroll Versions

exp-version-name

Provides the name for the exported Scroll Documents version, or exported version from Scroll Versions

exp-version-description

Provides the description for the exported Scroll Documents version, or exported version from Scroll Versions

exp-version-date

Provides the creation date of the exported Scroll Documents version, or exported version from Scroll Versions

exp-version-status

Provides the status of the exported Scroll Documents version

exp-variant-id

Provides the ID of the exported Scroll Documents Variant (requires Variants for Scroll Documents), or exported variant from Scroll Versions

exp-variant-name

Provides the name of the exported Scroll Documents Variant (requires Variants for Scroll Documents), or exported variant from Scroll Versions

exp-variant-description

Provides the description of the exported Scroll Documents Variant (requires Variants for Scroll Documents), or exported variant from Scroll Versions

exp-language-code

Provides the language code of the exported Scroll Documents translation (requires Translations for Scroll Documents), or exported translation from Scroll Translations

exp-language-name

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:

JS
// 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;
});
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.