Creating Pages with Templates, Regions, and Snippets

In the Webvanta system, you build pages by specifying a template, which defines the editable regions of the page and provides content such as header, footer, and navigation that doesn't vary from page-to-page.

Templates

A template is an HTML file with a little bit of special Webvanta code embedded in it, which provides the overall structure for the page. You can have as many templates as you want, but you need only a single template if all the pages of the site follow the same design. Templates generally should not have any page-specific content in them; they provide the framework that is common to all pages of a type.

Each template typically references one or more CSS and JavaScript files and includes whatever HTML head section code is required.

Regions

A template typically includes the header, navigation, and footer areas, and sometimes a sidebar as well, that don't vary from one page to another. For the page-specific content, a template defines any number of regions (typically a column, but it can be any area).

All page-specific content goes in the regions. The contents of a region can be edited by any logged-in admin user by simply hovering over the region, while viewing the web page, and clicking the Edit "gear" button in the top left corner. You can also edit regions from within the Control Panel by going to Pages, clicking on the page you want to edit, and then accessing the regions through the tabbed area; there is one tab for each region.

Snippets

Chunks of code or text that you may want to reuse in multiple place is best saved as a snippet. You can put any text or code you want in a snippet, and then you simply invoke it by name in a template file (or elsewhere). In our templates, we typically use snippets for the html head section, the visual header and navigation bar, and the footer. This makes it easy to have multiple templates, all using these same components.

WebvantaScript

You can use any standard HTML and JavaScript code in a region or in a template.

In addition, the Webvanta system has its own code, called WebvantaScript, that extends the HTML language and enables you to access the database and other features from within your pages. Webvanta Script can be used in templates, regions, and snippets.