How to use Toursys DocuBuilder tags and labels.
Generate the document template
What are Toursys Custom Labels, also known as tags, and how to use them?
Replacement tags are keywords or special codes inserted into a document template that are automatically replaced with specific information during the document generation process. These tags allow documents to be automatically personalized with dynamic data, such as names, dates, addresses, or other information that varies depending on the user or context.
How They Work
Replacement tags are formatted in a particular way, for example, enclosed in curly braces ({ }), or any other delimiter that clearly identifies the parts of the text to be substituted. We will be exploring each option in the following information down below.
During the document generation process, the system searches for these tags in the template and replaces them with the correct values, which come from a database or data source.
The following section will explain all the different ways a label can be used.
- Text Label
Format: {text}
Description: This label is used to insert plain text into the document.
Example:
{quotation_name}
Example in document:
Results:
2. Lists
Format: {#lists} ... {/lists}
Description: This label can be used to create iterations or conditional sections within the document.
List: Repeats the content within the labels for each item in the specified collection.
Example:
{#service_list}
{supplier_code}
{service_name}
{quotation_line_date}
{quotation_line_end_date}
{/service_list}
This will generate as many rows as there are items in the service list of the itinerary, each service will print with the information requested. In this example, it would print a list of all the services of the itinerary, each with a supplier code, service name, start date and end date.
Example in document:
Result:
3. Mathematical Operations Label
Format: {$ a + b}
Description: Performs the specified mathematical operation (+, -, *, /) on the given attributes.
Formatting Decimals: you can specify the formar of the decimals and separators
Format: {$ attribute1 + attribute2 | format:numberOfDecimals:thousandsSeparator:decimalSeparator}
Example:
{$ attribute1 + attribute2 | format:2:,:.}
If attribute1 is 10.2 and attribute2 is 5000, the result would be: 5,010.20
Example in document:
Results:
4. Image Label
Format: {%image}
Description: Embeds an image into the document.
Extra options:
Specifying size (width and height in pixels)
Specifying maximum size (max width and max height)
If no size is specified, it will get the image original size.
Example:
Basic embedding:
{%image1}
Specifying size (width and height):
{%image2 | size:250:100}
Specifying maximum size (max width and max height):
{%image3 | maxSize:300:500}
Example in document:
Results:
5. Dates
Format: {date_tag}
Description: Shows information regarding dates.
Extra options:
You can specify if you want to print only the day, month or year for the date. You must add this at the end of the tag you want:
_day
_month
_year
This tag is multilanguage, it will print the information in the language being specified.
Example:
{quotation_start_year_day} = Monday, Tuesday, Wednesday, Thursday, Friday
{quotation_start_year_month} = January, February, March, etc.
{quotation_start_year_year} = 2024, 2025, 2026, etc.
Current accepted formats to download the templates:
PDF
Microsoft Word
You can see and download the following Toursys Document Template we have as an example:
You can also see common mistakes you can avoid: