Conditional statements can be used in any template. They allow you to print different code based on a value of any tag. There are two versions of the conditional statement:
$(if) condition $(then) HTML-code-1 $(else) HTML-code-2 $(endif) OR
$(if) condition $(then) HTML-code-1 $(endif)
The first version will output either HTML-code-1 or HTML-code-2, depending on the condition. The second version only prints code when the condition is true. If it's not true, then nothing is printed.
HTML-code-1 will be output if the condition is true, or else HTML-code-2 can optionally be printed.
The condition can take one of the following forms:
XXX greater than YYY - where XXX and YYY are represented by numbers, e.g. '$(if) $(prop_persons) greater than 1 $(then) Please send us the name of the persons coming with you $(endif)' - this will print the text Please send us.... whenever the number of persons chosen at the time of reservation is more than one.
XXX less than YYY - where XXX and YYY are represented by numbers, e.g. '$(if) $(prop_persons) less than 2 $(then) A single-person surcharge of $20 was added to the price. $(else) Couples and families enjoy a discount at the restaurant... $(endif)' - depending on whether the reservation is for a single person or not, one of these two texts will be printed.
XXX equals YYY - where XXX and YYY can be numbers or any other text, e.g. '$(if) $(language) equals EN $(then) See you soon $(endif)' $(if) $(language) equals IT $(then) A presto! $(endif) - this lets you enter a different text based on the language chosen by client at the time of reservation
XXX contains YYY - where both XXX and YYY are texts, e.g. '$(if) $(resource) contains apartment $(then) Looking forward to your visit in our luxorious apartment! $(else) Looking forward to your visit in our lodge $(endif)' - For a site which has both lodges and apartments to rent, this lets you print a different message when the resource name contains the word apartment and another one in other cases (lodges in this example).
XXX - this checks if a tag is empty or not - e.g. '$(if) $(prop_I_need_airport_pickup) $(then) We'll be there to pick you up at the airport. Look for a tall guy with our logo printed on the jacket and holding your name! $(endif)' - If a tag is represented by any kind of text (the value is not empty), then the text will be printed. A tag is empty if for example it's an item in the reservation form which has no value. In this example, it's a yes/no value that was not selected.