Placeholders

Go back to the Tryout page:

 

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.

Also, the PTC Create Page Macro will automatically detect standard placeholders, even without an associated Placeholder Configuration Macro. This feature is showcased when copying the page with the button “Copy this page”. $$Name$$ will be detected as a placeholder, and you will be able to replace it.

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$$


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:

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

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:

Example for Cascaded Placeholders

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


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.