> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# Variables

> Reference for variables in WEBSALE templates: define custom var variables and use global $ws variables provided by WEBSALE modules in expressions.

Variables store values and can be used for checks, calculations, and outputs in the template.

You can define variables yourself by prefixing them with `var` and specifying a unique variable name after the mandatory `$`. In addition, there are also global variables provided by **WEBSALE** ([modules](/en/frontend/referenz/module)). These always begin with `$ws` and contain predefined functions or data fields.

|                              |                                                                               |
| ---------------------------- | ----------------------------------------------------------------------------- |
| `{{ var $myVariable = 10 }}` | The variable `$myVariable` is newly created and the value 10 is stored in it. |
| `{{ $myVariable = 42 }}`     | The value 42 is stored in the already created variable `$myVariable`.         |
| `{{= $myVariable }}`         | Output the current contents of `$myVariable`: **42**                          |

<Info>
  Note: `{{= $myVariable }}` outputs the value escaped/filtered (special characters/HTML are "neutralized" and displayed as text). To output the contents unfiltered, you must use `{{! $myVariable}}`.

  Assigning a value to a variable that has not been created — as with all invalid variable accesses — causes an error in the compiler. Creating a variable with a name that is already in use is not allowed in the same template.
</Info>
