The Adaptavist Group LogoDocumentation

Example: Return the Page ID

Instructions on creating a macro that will pull a specified Page ID onto a desired Confluence page.

You can create a macro to pull the Page ID of Confluence content onto a Confluence page.

Tip: This is a simple example of the way a custom macro can return page information. This example can be customized for different results.

Create the macro

  1. Select Create Custom Macro.
  2. Enter a Name to identify the Macro, like Page ID.
  3. Enter an optional Description, like Gets the page ID.
  4. Select Enabled to allow the macro to be added to pages.
  5. Select None for Body Type.
  6. Pick Block for Output Type.
  7. Enter the following script into the Script to Execute field:
    return parameters.get("pageId")
  8. Select Save.

The macro appears on the main Macros page.

Additionally, users in your instance can add it to Confluence pages. When it's added and the page is published, it appears like this:

Search documentation

Start typing to search the docs.