PTC Placeholders
Standard Placeholders
The placeholder marker is configurable in the Page Tree Creator settings. In the standard configuration, they are double dollars: $$placeholder$$
When using the Page Tree Creator, any placeholder from the source page tree/template is displayed in the replacement form and will be replaced with the user input.
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.
Default Placeholder | Description |
---|---|
$$Current_Date$$ | Place the current date |
$$Current_User$$ | Place the current user |
$$Current_Time$$ | Place the current time |
$$Current_Year$$ | Place the current year |
$$Current_WeekDay$$ | Place the current week day, e.g. Monday, Tuesday... |
$$Current_Day$$ | Place the current day within the month, e.g. 15 |
$$Current_Week_Number$$ | Place the current week number, e.g. 29 |
$$Current_Month_Text$$ | Place the current month as string, e.g. April |
$$Current_Month_Number$$ | Place the current month as number, e.g. 8 |
$$Template_Title$$ | Place the title of the template |
$$Template_Space$$ | Place the space of the template |
$$Template_Version$$ | Place the version of the template |
$$Source_Space_Title$$ | Inserts the title of the space where the original page is |
$$Source_Space_Key$$ | Inserts the key of the space where the original page is |
$$Target_Space_Title$$ | Inserts the title of the space where the new page is created |
$$Target_Space_Key$$ | Inserts the key of the space where the new page is created |
Cascaded Placeholders
Cascaded Placeholders are a feature that allows users to create templates from templates. This means that users can create a template with a placeholder that, when instantiated, creates another template with a placeholder. This process can continue, creating multiple levels of templates.
Syntax
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$$
Note: 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.
Iterations
Cascaded Placeholders can be used for multiple levels of templates. For example, the syntax $$$$$$author$$$$$$ would result in $$$$author$$$$ and then $$author$$, which could be used as a template for another placeholder. This process can continue for any number of iterations.
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$$$$
Use Cases
Cascaded Placeholders are useful in situations where users need to create complex templates that require multiple levels of placeholders. For example, if you are generating multiple pages and need to replace the author's name on each page with a different value. The cascaded placeholders allow you to easily replace the same placeholder multiple times without having to create multiple unique 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 the table below.
For example, if you want to use a date picker in the replacement form, you can add a %d at the beginning of your placeholder. It needs to look like this example: $$%d YourPlaceholder$$
By default, the Placeholder Marker will be $$ and the Format Marker %, if you have reconfigured them in your settings do not forget to use the ones you have set.
Format (shortcut) | Description | Result |
---|---|---|
Standard | This format allows the user to replace the placeholder with text. The user will be presented with a normal text input field in the replacement dialog. | StandardText |
Date (d) | This format allows the user to replace the placeholder with a date. The user will be presented with a date-picker in the replacement dialog To perform calculations (+/-) on the date, simply add an additional Format Marker % behind the date along with the time type into the date placeholder:
%+1m will add an additional month. The final placeholder looks like this: $$%d DateExample%+1m$$ |
|
Link (l) | This format allows the user to replace the placeholder with a link. The user will be presented with two text input fields in the replacement dialog. After the copy process the link will be displayed with the text entered in the first field. By clicking on the text the user will be redirected to the link entered in the second field. | |
Page (p) | This format allows the user to replace the placeholder with a page reference. In the replacement dialog a searchable dropdown will appear where you can search for page titles. After the copy process, a link to the selected page will be displayed. | |
Multiline (ml) | This format allows the user to replace the placeholder with text. The user will be presented with a multiline-text input field in the replacement dialog. | MultilineText_This text is artificially long to demonstrate the featured of the "Multiline" placeholder format |
Dropdown | This format allows the user to replace the placeholder with text. The user will be presented with a dropdown menu with multiple options in the replacement dialog. The user can replace the placeholder with one of these options. | Option3 |
Multi-Dropdown | This format allows the user to replace the placeholder with text. The user will be presented with a dropdown menu with multiple options in the replacement dialog. The user can replace the placeholder with multiple of these options. By default the options will be separated by comma. This can be changed in the macro config. | Option2,Option3,Option7 |
Regex | This format allows the user to replace the placeholder with text. The user will be presented with a normal text input field in the replacement dialog. The user will only be able to submit a value that is accepted by the regex defined in the macro config. | 1.44 |
Required (r) | When using the Placeholder Configuration Macro any placeholder of any format can be set as “required” by checking the correct checkbox in the macro. The user also has the option to set a standard placeholder as required without using the macro. For this the user needs to add “%r” to the placeholder when setting it. E.g. $$%r ReqExample$$ | StandardText |
User (u) | This format allows the user to replace the placeholder with a user mention. When using the Placeholder Configuration Macro choose the “User” type. Or use the format marker followed by a “u”: E.g. $$%u UserExample$$ In the Replacement dialog a searchable dropdown will appear with all users on the current instance. | User mention @Alice |