Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel6
outlinefalse
styledefault
typelist
printablefalse

Documentation: PTC Placeholders

Standard Placeholders

Info

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

Ptc tag description
dropdown-separator
info-textReplace the standard placeholder example.
regex-input
tag-id$$standard_placeholder$$
format-idSTANDARD
dropdown-entries
required-idtrue
multiple-dropdown-selectfalse
config-macro-hiddentrue

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

Ptc tag description
dropdown-separator
info-text
regex-input
tag-id$$Current_Time$$
format-idSTANDARD
dropdown-entries
required-idtrue
multiple-dropdown-selectfalse
config-macro-hiddenfalse
Panel
bgColor#FFFAE6

List of all Default Placeholders

Info

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:

Info

$$$$placeholder$$$$

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

Info

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

Info

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

Example for Cascaded Placeholders

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

Ptc tag description
dropdown-separator
info-text
regex-input
tag-id$$$$$$Cascaded_Placeholder$$$$$$
format-idSTANDARD
dropdown-entries
required-idtrue
multiple-dropdown-selectfalse
config-macro-hiddentrue
Panel
bgColor#FFFAE6

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.

Info

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.