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.
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:
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.
||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.
||Applies to all links in the page.
||The header row of a grid view.
||Applies to rows of data in a grid view.
||Field captions in a details view.
||Field values in a details view.
||Inputs and selects within forms.
||Captions of fields within forms.