Command Codes

Below is a list of the available command codes and a description of each.

{#prompt:variable-name}

This code displays a one-line text entry box into which the user can enter text to replace the code. variable-name is then assigned that value for later use.

{#promptmulti:variable-name}

Behaves in the same way as prompt, but this time uses a multi-line text entry box. Each line of text is automatically ended with a <br> tag.

{#formatting:variable-name}

Displays the Font Wizard so that the user can select a formatting effect for the subsequent text.

{createtag:tag-name}

Loads the wizard for the appropriate tag as specified in the tag-name parameter. Possible values for tag-name are:
{#loop:variable-name/iterations} ... {#endloop:variable-name}

Defines the start and end of a loop. Once Constructor encounters a loop command, it processes the information between the loop command and it's corresponding endloop command, according to the value of iterations. If this is a valid integer, the intervening text is repeated that many times. If it is "prompt", then the user is asked each time before entering the loop whether they want to continue for another iteration. If they answer Yes, the code is repeated. If they answer No, then they are moved on to the endloop command.

{#plugin:filename}

Executes a plugin with the given file name. The file name does not include the path part as all the plugin files must be in the same folder.

{#define:type/variable-name/value}

Assigns value to variable-name, where variable-name is a variable of type. If variable-name is used again later in the template, provided that they two instances are of the same type then the second and later instances will be automatically replaced with value without prompting the user. Possible values for type are:
Notes

Variable names are case sensitive. If you have two commands, {#prompt:e-mail} and {#prompt:e-mail}, when the user is prompted for a value for e-mail from the first command that value is stored and when Constructor then reads the second command, it will automatically be replaced by the value assigned to the first command. However, if the two commands were {#prompt:e-mail} and {#prompt:E-mail}, then the user would be asked for values of both e-mail and E-mail.

Variables assigned to in a loop loose their value at the end of the loop. Although variables retain their values between commands, if a variable is assigned a value in a loop then that value is lost for subsequent iterations and when the loop ends. This enables you to perform functions such as:

{#loop:paragraph/2}
<b>{#prompt:Paragraph Heading}</b>

{#promptmulti:Paragraph Text}
{#endloop:paragraph}

In this example, the commands {#prompt:Paragraph Heading} and {#promptmulti:Paragraph Text} are repeated twice, but each time they are encountered the user is asked again for their value, as the values which were assigned to them on the first iteration are lost when the loop is repeated. If this was not the case, the first and second paragraphs which the code would create would be identical and therefore useless.

Loops cannot overlap. While loops can be nested (you can have one loop inside another), loops must be ended in the opposite order to that in which they were created. For example:

{#loop:loop1/2}
    Place some text here
    {#loop:loop2/2}
    Some text here too
{#endloop:loop1}    <-- Error here: loop1 closes before loop2 when loop2 started within loop1
    {#endloop:loop2}

This code should look like:
{#loop:loop1/2}
    Place some text here
    {#loop:loop2/2}
    Some text here too
    {#endloop:loop2}
{#endloop:loop1}

Constructor's behaviour on encountering loops which overlap is undefined.