The content of a Viaweb site is represented as a collection of objects. For example, each item or section is an object. An object has an id, a type, a template, and zero or more properties.
The properties an object has depend on what type of object it is. An object representing an item for sale, for example, would probably have at least a name, an item number, a price, and a description.
Ordinarily, each object corresponds to one Web page. The object's template defines what that page will look like. Viaweb has a set of predefined templates, but you can easily define new templates of your own.
A template is a series of RTML expressions. An expression is either simple, e.g.
or complex. A complex expression consists of an operator, and zero or more arguments, which are themselves expressions. For example:1
The preceding expression consists of a TEXT operator and a single, simple argument, the number 1. Its effect is to print 1 on the page being generated.TEXT 1
When a template is used to generate a page for an object, the expressions in the template are evaluated in order. When an expression is evaluated, it always returns a value, and may also have side-effects like generating output.
Whenever a template is used, there is a current object and a current page. The current object is the object whose page is being generated. If the template refers to properties, they default to the properties of that object. The current page is the page being generated. If the template generates output, it becomes part of that page.