Skip to end of banner
Go to start of banner

Placeholders

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current Restore this Version View Page History

« Previous Version 5 Next »

Documentation: PTC Placeholders

Copy this page, to see how the example placeholders are replaced.

Standard Placeholders

Placeholders can be used in page titles, macro parameters, labels, URLs and attachment names!

Example: "$$Name$$" can be replaced with your name "John Smith"
Every "$$Name$$" placeholder that is in the document will be replaced with "John Smith.

In the default settings, the placeholder marker corresponds to a double dollar sign "$$", but this can be configured to your choice of marker.

Example for Standard Placeholder

$$standard_placeholder$$


Default Placeholders

Default Placeholders can be inserted like normal placeholders, but get replaced automatically since the value is already fixed, they do not appear in the replacement dialog.

Example for Default Placeholder

$$Current_Time$$

List of all Default Placeholders

You can create your own default values for your placeholders with the Default Value Macro (PRO). You can find examples here: (insert examplepage).


Cascaded Placeholders

Cascaded Placeholders allow users to create templates from templates. These Placeholders create another template with a placeholder when instantiated. This process can continue, creating multiple levels of templates.

To use cascading placeholders, enclose a placeholder in two or more placeholder markers like this:

$$$$placeholder$$$$

This will result in the instantiation of the placeholder, which can then be used as a template for another placeholder:

$$placeholder$$

When using a cascaded placeholder e.g. $$$$placeholder$$$$ it will be automatically converted to $$placeholder$$ without being shown in the replacement dialog when the page or space is being created.

This can continue indefinitely. Just put 2 more “$$” at the front and back of the Placeholder for every layer you desire.

Cascading placeholders can also be created by replacing an existing placeholder with a cascading placeholder in the replacement dialog:

$$author$$ replaced by $$$$author$$$$ becomes $$$$author$$$$

Example for Cascaded Placeholders

$$$$$$Cascaded_Placeholder$$$$$$

More Information about Cascaded Placeholders


Placeholder Formats

All Formats can be defined by using the Placeholder Configuration Macro. Some formats can also be defined by using their shortcut directly when setting the placeholder. For all formats that support shortcuts, the shortcut will be listed next to the Format in Placeholder Formats.

For example, to use a date picker in the replacement form: $$%d YourPlaceholder$$.


Placeholder Macros

Placeholder Configuration Macro

Documentation: Placeholder Configuration Macro

The Placeholder Configuration Macro has been used multiple times in this demonstration, and specifically on this page. It allows the author of a template to set a placeholder format, if it is required, description and dropdown options automatically to a Placeholder.

The Placeholder Configuration Macro can be placed within any page of the page tree and if there are multiple of the same placeholder, will favor the placeholder configuration macro in the same page or work its way up the tree.

Inheritance Concept:

image-20240311-122210.png

If a page does not contain a macro and the page is a child page down the page tree, it will search upwards for a configured placeholder macro and will keep working up until it finds a parent page that contains a placeholder configuration macro.

To find more Information about the Parameter-Types, please go to: Macro Parameters

Ignore Placeholder Macro

The Ignore Placeholder Macro allows you to retain placeholders when copying a template. To achieve that, you just have to insert the placeholder inside the body of the Ignore Placeholder Macro.

It is also possible to add other Confluence macros to the body of the Ignore Placeholder Macro. In that case, the macro parameters won't be replaced and references will point to the same location as before copying.

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.