Skip to content

Create a template ​

Templates are HTML documents with placeholders that are filled in with data when you print or send a record — for example a letter to a partner or a contact summary. Each template belongs to one model (partners, contacts, orders, …), so its placeholders always match that model.

1. Open the Templates page ​

Go to Templates and click + in the top bar.

The Add button on the Templates pageThe Add button on the Templates page

2. Fill in the basic information ​

  • Name — how the template is shown when you pick it later. Required.
  • Document type — the model the template is for (partners, contacts, orders, …). It decides which placeholders you can use, and it can’t be changed after the first save.
  • Template type — what the template is used for, for example Print for a PDF or Mail for an e-mail. Required.
  • Layout — which page header and footer the printout gets (header-footer by default, no-header, only-footer, …).
  • Landscape — print the page sideways.
  • Active — only active templates can be picked.
  • Printer — optional default printer for this template.
  • Template engine — placeholder for templates like this one, written in the visual editor with [placeholders]; twig for code templates that can extend each other (see Write a Twig template).

The basic information of a new templateThe basic information of a new template

3. Add styling (optional) ​

Under Template content, the CSS box takes regular CSS that is applied to the template — for example fonts, colours or table borders.

The CSS boxThe CSS box

4. Save the template ​

Click Save. The template opens again, now with the Content editor unlocked.

NOTE

The Content editor is locked until the template has been saved once, because the placeholders depend on the Document type.

5. Write the content ​

Type the text of the template in the Content editor. The toolbar works like a word processor: bold, headings, lists, tables, images and so on.

6. Insert placeholders ​

Click + in the editor toolbar to open the list of placeholders for the template’s document type, then click a field (for example Short name) to insert it where the cursor is. When the template is printed, each placeholder is replaced with the value from the record.

The + button in the Content toolbarThe + button in the Content toolbar

The list of placeholdersThe list of placeholders

Placeholders are written in square brackets, so you can also type them by hand:

  • [short_name] — a field of the record.
  • [relation.field] — a field of a related record. Click a bold relation in the list to expand it and pick one of its fields.
  • A list of related records, such as order items, is wrapped in a start and an end element: everything between [items] and [/items] is repeated for each item. Use Start element and End element at the top and bottom of the expanded relation to insert them.

TIP

Click the copy icon next to a placeholder to copy it to the clipboard instead of inserting it.

7. Format values ​

Add a formatting function after a | to change how a value is shown. The functions you can use are listed under Content, next to Available functions.

FunctionExampleResult
date[created_at|date]07.10.2026
amount / price[total|amount]1.234,50
qr_code[document_number|qr_code]a QR code image of the value

The available functionsThe available functions

Placeholders in the template contentPlaceholders in the template content

8. Preview with a real record ​

Pick a record in Preview with record above the editor — a partner here, because of the template’s Document type. Then click the eye icon in the toolbar to see the template filled in with that record’s data.

Preview with record above the editorPreview with record above the editor

TIP

Click the gear icon next to Content and turn on Html input to edit the raw HTML instead of using the editor.

9. Save ​

Click Save. The template can now be used for records of its document type.