Adding Site Variables documentation for the dotCMS Content Management System

When managing multiple websites it is sometimes necessary to record information specific to each site. Although values that are common to all sites can be added to the Site Content Type as additional fields, there are times when data is unique only to a few sites or different on every site. In these cases unique values that refer to specific sites are better stored in specific site variables.

To add a site variable to a site use the following steps:

  1. From the CMS Admin tab click Sites from the drop down menu.

  1. Using the site variable manager, click on “+Add new Site Variable
  2. Provide a name for the variable- this is just a label
  3. Provide a unique key for the variable- this is the variable name by which the value can be called dynamically
  4. Provide the site specific data in the value field

After setting site variables, they can be called dynamically anywhere on ANY site using the following Velocity statement:


${esc.d}host_variable is a reserved variable and the key refers to value set in the keyfield of the site variable.