Search these areas:
Help
Support Forums
Product Info



Introduction
DataWeb: What's New
Creating an Application
The DataWeb Designer
Application Management
Data Tables
Data Tables
Views
Templates
-Understanding Templates
-Customizing Templates
Components
Data Analysis
Members
Security
Importing
Exporting
FTP
JavaScript
Object Model
Full-Text Search
Domain and Email Hosting
HotBlock Modules
Account Management
Glossary
New Responsive UI Module





DataWeb Help
Support Forums
Tutorial
Script Library
Knowledge Base

Home > Support

DataWeb User's Guide

Customizing Templates
You can customize a template by modifying the general layout of the page, the links in the navigation bar, and the formatting of the page and the views that are displayed within it.

The Template

A template is a view file that contains the <ws:include /> tag, without a value specified for its src attribute. The <ws:include /> tag indicates where the template should display views.

The simplest template that you can create would look like this:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ws="http:/www.DataWeb.com/_dtd/ws.dtd">
<head>
</head>
<body>
<ws:include />
</body>
</html>
You can customize this HTML however you wish.

Changing Template Layout

You can edit the HTML to change the layout of a template. Open the template in the DataWeb Designer, and display it in Source view. Make sure that the <ws:include /> tag exists somewhere in your template, so that the DataWeb Engine knows where to display views within the template framework. After you edit the source, click the Fix XML button to find and correct any errors, then click the Save button to save your view.

Updating Links on a Template

If you create a new view using the wizard, you will be asked if you want to add a link to this view from the global navigation bar. (The global navigation bar appears on the default template which is created automatically every time you create a new web.) By default, this link will be inserted to the global navigation bar. If you do not want this link to appear on the global navigation bar, then click on the check box to remove the check mark.

The wizard looks for the <ws:navbar> tag to determine where to put the new link.

In the view source, the <ws:navbar> tag appears follows:

<ws:navbar id="mainnav" layout="vertical"> (links go here)</ws:navbar>

The layout attribute can be set to "vertical" or "horizontal". If the attribute is set to "vertical", the link is inserted as a new row on the navigation bar. If the attribute is set to "horizontal", the link is inserted on the same row as existing links.

Changing Formatting of Views within a Template

Templates make it possible to change the formatting of multiple views by modifying just one file. Templates use a standard cascading style sheet (CSS) file, default.css, that's added to your web when you create it. The color theme you select when you create a new web determines the contents of your default.css file.

Style sheets are a powerful means of formatting HTML files. A complete discussion of style sheets is outside the scope of this page, but you can find more information at WebMonkey or in books from O'Reilly.

DataWeb views employ a number of CSS classes to format different parts of the page. Here's a table listing the major CSS classes used by views.

Class Name Description
body This is the default formatting for the body of your document. If you are using your own custom template based on HTML, you'll probably want to edit or delete this style.
a Applies to all links in the page.
.ws-thead The header row of a grid view.
.ws-data-td Applies to rows of data in a grid view.
.ws-detailcaption Field captions in a details view.
.ws-detaildata Field values in a details view.
.ws-formelement Inputs and selects within forms.
.ws-formfieldcaption Captions of fields within forms.

Related Topics

Page Region

Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
Email Us