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.
Format: {text}
Description: This label is used to insert plain text into the document.
Example:
{quotation_name}
Example in document:
Results:
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:
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:
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:
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.
Format: {=if({tag} != , "Foods Includes: {tag}", )}
Description: This formula follows a basic "if / else" logic, which means: “if something is true, then do this; otherwise, do something else.” It works by checking a condition and then choosing what to show based on whether the condition is true or false.
You can use the following options to compare data:
Equal: ==
Not equal: !=
Greater than: >
Less than: <
Examples:
{=if({quotation_lines_by_day_food_includes} != , "Foods Includes: {quotation_lines_by_day_food_includes}", )}
Result when quotation_lines_by_day_food_includes is not empty:
Foods Includes: Lunch, Dinner
{service_name} {=if({quotation_line_service_optional} == Yes, )}
Result when quotation_line_service_optional is Yes:
Guided tour to the city - Optional
Format: {&conditional tag} ... {/conditional tag}
Description: This tag will allow you to show or hide information, depending on the specified tag. The tag must be a "Yes" or "No" option to verify.
Examples:
{&conditional service_is_hotel}
Check in: {service_check_in}
Check out: {service_check_out}
Breakfast: {service_has_breakfast}
Lunch: {service_has_lunch}
{/conditional}
If the service is a hotel, then the information of Check in, Check out, etc. will be shown on the document. If not, the information will not be shown on the document for that specific service.
Current accepted formats to download the templates:
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: