Go to the home page of the Sitevision help website

Script - Variables

Variables make it possible to declare variables outside the code itself. These variables are then easier to adjust without having to go in and read (or understand) the script.

Use

Variables can be added, edited, and deleted.

When a variable is added, it must be given a variable name (which is also what you type in the code to use the variable.) You specify with a checkbox if it is mandatory to assign a value to the variable.

You can provide a description to facilitate future adjustments to the variable 

Finally, you select the variable type and can assign an initial value to the variable.  

Available variable types

  •  Boolean value
  • Single selection
  • Multiple selection
  • Style sheet
  • Colour
  • Integer
  • Metadata
  • Node in image archive
  • Node in file archive
  • Node in page tree
  • Page template
  • Text

Use

To use a variable in the script, enter scriptVariables.VARIABLENAME (JavaScript) or $scriptVariables.VARIABLENAME (Velocity).

In the script, the variable can then be used in the same way as variables declared inside the script.

The page published:

Did the information help you?

help.sitevision.se always refers to the latest version of Sitevision

Follow us