Receipt template elements
A template is a complex sub part of the receipt. A template can contain all other receipt elements, including new templates.
Note
In a receipt in the work area of Receipt Builder, templates are highlighted in yellow.
A template can exist more than once in a receipt. If it does, it appears the same for all occurrences. If you change the content of one instance, it affects all the other instances, which is the purpose of having a template.
A template is always connected to a data element. The data element doesn't have to be part of the template itself but it usually is. The template is only visible if the connected data element exists. If the data element doesn't exist, the template contents are invisible. Receipt Builder shows a template as at least one line. The template is highlighted in yellow to separate it from other receipt elements. This makes it easier for you to edit the templates.
If a data element exists more than once, the content of the template is repeated once for every occurrence of that data element. If you use the data element inside the template, it has one template instance for each data value.
You can't edit template properties from a receipt. To edit the template properties, you double-click to open the template editor in Receipt Builder. There you can edit the template properties.
You use templates to control the visibility of a line.
You have a data element called [user] and a row with two columns – one column with the label 'User:' and one column with the value of the [user] data. for example, User; 1234.
If the [user] data element doesn't exist for any reason, such as no user was signed in when the receipt was printed, then the row looks like this: User:.
Maybe this is the result you want, but in some cases you may not want that row to be visible at all. In that case, you add a template for the [user] data. Inside the template, you add the same row with the same two columns as you would have otherwise. If the data element exists, it is shown just as before. If the data element doesn’t exist, the row isn't shown at all.
External templates
An external template is not connected to any data element, unlike a standard template. External templates are references to external layout files that can be reused. That is, shared among several different receipts. Even if a layout is external, it operates on the data and language elements for the receipt.
In Receipt Builder, external templates are used to get a common header and footer in receipts. This also applies for all standard Connect on-Device receipts. In Receipt Builder, you can only control the receipt header and footer using external templates.
To edit an external template, you must first close the current project and then open the project for the external template and make your edits there.
[1] It's important that you don't have any circular template references. Receipt Builder always checks for circular references when you add a new template.