Use Page Properties as Custom Placeholders
You can use Confluence page properties to define customized text placeholders in your exports.
Create page properties
To start, you need to create the page properties to be used as placeholders.
- Navigate to your export's root page (the parent page where the export is started from). This is required because page properties are always taken from the export root page.
- Insert a Page Properties macro on the page
Add a two-column table into the macro body, with the left column containing the keys (i.e. the page property names), and the right column contains the corresponding page property values. The added table should contain a left header column for the keys like this:
Key#1 Value#1 Key#2 Value#2
Using multiple page property macros?
If you insert multiple page property macros on this root page (the page you start the export from), you have to assign an ID to each macro, so you differentiate between them when you refer to them in your export template.
Use the page property as a placeholder
Now you can use the content that you defined in the right-hand column as a placeholder in your export.
- Open your template and insert a Page Property placeholder.
- When you insert the placeholder, you have to define the Page Property field – here, enter the name of the page property (the left-hand column in the table in the page property macro) which corresponds to the value that you want to add to your export (the content in the right-hand column). If you used multiple page property macros on the root page, add the Macro ID that you defined for the appropriate Page Properties macro.
The value of the page property should now replace the placeholder in your exports.
Tip
The Page Property placeholder provides two options for defining how the content is rendered in the generated PDF. These are:
- Display Inline - for preserving page property values that should remain inline
- Display on new line - for preserving page property values that contain list styles or multiple lines of content