Using WebvantaScript

WebvantaScript

WebvantaScript is the Webvanta platform’s scripting language. You can use it interchangeably with HTML in templates, snippets, and pods.

With a few WebvantaScript instructions, you can access content stored in the content management system or in the database, and insert that content into your HTML.

Keep in mind that the browser knows nothing about WebvantaScript. All tags starting with w: are interpreted by the Webvanta server. In response to a typical WebvantaScript tag, the server selects information from the database and inserts it in place of the WebvantaScript code in the HTML document.

WebvantaScript Structure

Each WebvantaScript statement (sometimes called a Webvanta tag) has the following structure:

<w:tagname parameter=value parameter=value … >

All statements begin with <w: followed by the name of the tag. In some cases, that’s all that’s required.

Often, however, you want to specify one or more parameters, which you do simply by entering the name of the parameter, followed by an equal sign, followed by the value of the parameter. If the value is a string, it must be in quotes.

Webvanta tags must be correct XML, which means that they must all be closed. Some can be self-closing:

<w:tagname parameter=value />

Note the slash before the close bracket. It is required for a self-closing tag (just as in XHTML).

Some tags are designed to surround a block of text or other code. In this case, the opening tag is of the form:

<w:tagname parameter=value />

And then, after some amount of other content or code, a closing tag is required, which looks like this:

</w:tagname>

Again, this is just like XHTML.