Templating: Basics
- 1 Open template in editor
- 2 In the editor
- 2.1 Edit content
- 2.2 Templating group
- 2.2.1 Bind field
- 2.2.2 Insert snippet placeholder
- 2.2.3 Insert placeholder
- 2.2.4 Developer tools
- 3 Test document
Are you a template administrator and would like to edit a template or create a new template? Learn the basics of templating in this article.
If you are not yet familiar with the template editor, find out more here: https://primesoft-group.atlassian.net/wiki/x/AQDZEQ
Open template in editor
To edit a template in the corresponding Office application (e.g. Word), select the Editor button in the template editor or use Ctrl+E
.
First make sure you know where exactly you need to make a change. In the header or in the content? Open the correct template in the template hierarchy.
In this example, the Letter template is being edited using a content template. If you have several language versions of the template, first select which language version you want to edit.
The template is now opened in the respective Office application, in this example Word.
In the template editor The Properties, Profile and Document language buttons are deactivated.
In the editor
Edit content
(1) As we are editing a content template in this example, you can completely ignore the headers and footers when editing - these are already defined in the layout. Read more about the template hierarchy here: Templates and template types | Word templates
All entries in square brackets, e.g. [Salutation], are primedocs fields. If you click on the [Salutation]
field, you will see Salutation (Field, unmapped). This means that it is a primedocs field that was not defined in the Placeholder Mapping document function, but is a field that comes directly from the Fields document function.
Templating group
(2) The “Templating“ group offers primedocs' own tools to dynamize the template. The following buttons are available:
Bind field
The pop-up window that opens allows you to select profile fields and fields that have been configured in the Fields document function.
Insert snippet placeholder
A snippet placeholder can be filled with one of the two text module types in the Fields document function: WordContent or FormattedText. In most cases, you will insert WordContents in the suitable place.
Insert placeholder
The placeholder is the container for inserting dynamized content into the header or footer of a layout template. Dynamized content can be profile fields or a field defined in the Fields document function, for example.
This button is deactivated in this example because we are in a content template and not in a layout template.
Developer tools
The developer tools help to track and check fields as well as content in generated documents. They display the entire template as XML.
Test document
Once you have edited the template, you want to check whether your changes are correct in a generated document.
Return to the template editor and click on “Test document” or use Ctrl+T
. Now fill in all the parameters as if you were a user. The document will then be generated in test mode.
Template editing group
The advantage of testing a document is that the template editing group is then available to you in the open Word document, with the following options:
Generate preview
A "snapshot" is taken of the document at that moment and set as a preview image for this template.
Generate multilingual previews
Generate a preview image depending on the document language.
Developer tools (Test)
See the following explanation: Developer tools.
PrimeSoft AG, Bahnhofstrasse 4, 8360 Eschlikon, Switzerland