pad
Global Variables

Every Viaweb site has a collection of global variables that control its appearance. They are called global because, by default, they apply to every page.

If a template contains an @ followed by a name that is not one of the current object's properties, it will instead refer to the global variable (if any) with that name. For example, this template


Background ()
TITLE "Hello Background"
BODY background-color @background-color
  TEXT "Hello, world!"
generates a page we have often seen before, except that the background color will be the value of the global variable background-color (which by default is no color at all).

Since @ looks first at the properties of the current object and only second at the global variables, you can override a global variable for any particular object by giving it a property with the same name. For example, if you give some object a new property called background-color, then its value will be used instead of the global variable when a page is generated for that object.



Sales: 1-888-4-VIAWEB or sales@viaweb.com.
Support: 1-617-876-9678 or support@viaweb.com.