This is where the Helper folders in the configuration come into play.
The concept to bear in mind is this: when a template is run by XpressDox, the internal environment is set up according to the configuration of the folder in which that template was saved (i.e. the folder where the template is run from). In other words, every time a template is run, XpressDox makes sure that its containing folder’s configuration is active.
To make sure that those templates which require a letterhead all use the same letterhead, there are a few things to set up:
- First, the letterhead template must be created, and must be saved in a suitable location (in the case of a multi-user environment, a suitable location would be a shared folder on the network). For this example, suppose that location and file name is P:\SharedArea\Templates\Utilities\Letterhead.xdtpl
- A short name (Alias) must be decided on for the folder in which the Letterhead.xdtpl template is stored. In this example, “utilities” would be a good choice (note that the Alias does not have to be the name of a folder or sub-folder, so names like “basetemplates”, “docs”, etc. are equally acceptable)
- Every template requiring that letterhead must have the following command
«BaseTemplate(utilities:Letterhead)»on the first line (on its own in that paragraph) of the template.
- When a template with the
«BaseTemplate(utilities:Letterhead)»command is run, XpressDox will look in the configuration of that template’s containing folder to find the path to where the Letterhead.xdtpl template can be found. In other words, it will look for a definition of the Alias “utilities”. For this to succeed, the Alias must be defined in the Helper Folders tab in the template folder’s configuration. This is done as follows:
- Run the XpressDox Configuration, select the template folder as the “Configuration for folder”, and select the Helper Folders tab.
- If there is no Helper folder with alias “utilities”, then create one by pressing the “New Helper Folder” tab and enter the path (in this example P:\SharedArea\Templates\Utilities) and alias (“utilities”)
- Save the configuration.
This means that regardless of where a template is saved, as long as the folder in which it is saved has the “utilities” Helper Folder configured to the Letterhead template’s containing folder, and the BaseTemplate command refers to the template as “utilities:Letterhead”, then the correct letterhead will be used.
You do not have to include the file extension .xdtpx (or .xdtpm) when referring to a template in any XpressDox command. If omitted, the extension is inferred as .xdtpx (or .xdtpm, depending on how the template was stored).
The configuration screen for a typical template folder which was configured as above would look something like:
For a more advanced application of configuration which also applies to the subject of letterheads as well as other configuration options, please see the Cookbook article Configure a multi-application environment.