Site variables
Write a value once (phone number, opening hours, price) and find it everywhere on the site, in every language.
What it is for
A phone number, opening hours, a price, an opening date: some values come up on several pages. Define them once as variables, write their name between double curly braces in your texts, and TOWeb replaces them with their value when it builds the site. Change the value: the whole site follows.
Creating a variable
- Open Settings › Advanced, Variables section.
- Click Add a variable.
- Give it a Name, for example telephone, and a Value, for example 01 23 45 67 89. The variable is saved as soon as you leave the field.
- The copy button, to the right of the variable, puts its name between curly braces on the clipboard: paste it into a text.
Writing a variable name
A name starts with a letter or a digit, then contains only letters, digits, dots, hyphens or underscores: no spaces or accents.
Using it in a text
In any text on the site (paragraph, heading, button, product description, SEO title or description), write the name between double curly braces: {{telephone}}. In the editor, you see the name; in the Preview and on the published site, you see the value.
A typo shows
A misspelled or deleted variable stays displayed as it is, with its curly braces. A quick look at the Preview is enough to spot it.
One value per language
If your site is translated, the One value per language button, to the right of the variable, opens one line per language. Leave it empty to reuse the value of the main language, or enter a value of its own: “9 h à 18 h” in French, “9 am to 6 pm” in English.
Automatic translation never touches a variable: it translates the sentence around it and keeps the name between curly braces as it is. See Translating your site.
Your TOWeb 14 fields
When you import a TOWeb 14 site, text fields (written %NOM% in TOWeb 14) become variables: %SLOGAN% is written {{SLOGAN}} in your pages, and its value is found in Settings › Advanced › Variables. See Reading the import report.