Skip to content

Template Language

lvanderlyn edited this page Aug 10, 2023 · 4 revisions

Template Language

Anything between {{ }} will be interpreted as an expression and the result of that expression will be evaluated to the user

  • {{ VAR }} -> will output the value of the variable VAR
  • {{ VAR + 5 }} -> will output the value of VAR plus the number 5
  • {{ VAR == 5 }} -> will output True if VAR is equal to 5 otherwise False
Bildschirm­foto 2023-02-24 um 14 33 53 Bildschirm­foto 2023-02-24 um 14 34 22

The syntax language supports the creation and evaluation of arbitrarily complex expressions, but does not support assignment.

It is important to leave a space between the braces and the input

It is important to refer to variables with the same capitalisation they were defined with.

The template syntax also supports returning information from tables.

  • {{ TABLE_NAME.COLUMN_NAME(VAR) }} -> returns the value of an entry from the column COLUMN_NAME from the table TABLE_NAME at the row where the column VAR has has the value stored in VAR.
    • For example, if you have a table called "hotel_costs", with a column "country" and a column "cost" the following expression: {{ hotel_costs.cost(country) }} would return the cost associated with a given country.
  • {{ TABLE_NAME.COLUMN_NAME(VAR1, VAR2) }} -> returns the value of COLUMN_NAME from the table TABLE_NAME at the row where the column VAR1 has has the value stored in VAR1 and the column VAR2 has the value stored in VAR2
    • {{ DAILY_COSTS.PER_DIAM(COUNTRY, CITY) }} -> Returns the Per diam from the table daily costs, for the country and city specified by the user
Clone this wiki locally