Using WebvantaScript

Contents

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. We’ve provided all the code you’ll need for typical KB access as part of the standard KB pages and in snippets. Advanced users can write their own WebvantaScript or modify the code provided to customize the presentation of KB contents.

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.

Common WebvantaScript Tags

Example Description Where Used
<w:title /> Returns the text for the page’s title. Typically used in the layout to render the HTML Title tag, and can be used in the body of the page if desired to render the title there. Layout (HTML head section); may also be used in page body (in a pod or snippet)
<w:meta /> Returns a set of HTML meta tags with the keywords and description for the page. Layout (HTML head section)
<w:stylesheet_webvanta />
<w:javascript_ajax />
<w:javascript_webvanta />
These three tags load the base Webvanta stylesheets used for admin functions, the AJAX libraries, and JavaScript code required for in-place editing. Layout (HTML head section)
<w:snippet name='snippet_name' /> Returns the contents of the named snippet. Anywhere
<w:asset name='asset_name' /> Returns the URL for an image, document, or other uploaded asset. Anywhere
<w:podcontainer name='name' /> Defines a region within a layout where pods can be placed. Layout (body section)

Add Your Comments

(not published)