Development

How do I include a page's ID in its contents?

Each asset in Cascade CMS has an unique ID, visible in the URL when viewing the asset in the interface. Including a page's ID in the published page source can be useful for things like deep linking to Cascade CMS from Siteimprove, DubBot, or other third-party reporting platforms.

You can include page IDs in your templates with a system-region and the $currentPage.identifier.id Velocity method.

For example:

  1. Create a Velocity Format containing the following:

    <meta name="id" content="${currentPage.identifier.id}"/>
  2. Create a new region within the <head> tags of your Template(s). Example:

    <!-- Page ID for deeplinking. -->
    <system-region name="PAGE_ID"/>
  3. Attach your Format to this new region in your Template(s).
  4. Publish all pages that use the Template(s) to ensure that your page ID <meta> tag gets included the pages on your web server.