[Inso Home Page] [Home] [Collection] [Book] [Expand] [Collapse] [Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] [Preferences] [Print] [Help]

 inside  Expand Search


   General Information   [Table of Contents]    URL Components

DynaWeb Publishers Guide

[-] 5. Modifying The DynaWeb Interface
[-] Overview of Templates

Overview of Templates

What Are Templates?

Templates are Tcl constructs that control the layout and content of DynaWeb pages. They are identified in the configuration files by the template command dwTemplate, followed by the name of the specific template. The purpose of a DynaWeb template is to allow Tcl procedures and commands to be embedded into an HTML document. By doing this, DynaWeb enables a single HTML source to modify itself "on-the-fly", adapting to the environment of each specific request.

The Construction Of A Template

Syntax

Each template begins with the command dwTemplate and the name of the template (in this case, Frames__RootCollectionView). The body of the template is surrounded by braces ( { and } )

Note: Template and script names (such as the one below) contain two adjacent underscores (__) in their names, not one(_).

Two underscores: Frames__CollectionView
One underscore : dwSetParam button_parameter

Function

This template sends the HTML used to display the available collections. Templates are not limited to containing HTML, but can also contain commands that retrieve information from the server, the client, and elsewhere in DynaWeb's configuration files. The example below contains three commands in addition to the HTML: dwGet, dwSet, and dwCall.

Sample

Below is a sample template:

dwTemplate Frames__RootCollectionView {
<HTML>
  <HEAD>
    <BASE HREF="$[dwGet BaseUrl]@Frames__RootCollectionView">
  </HEAD>
  <BODY BGCOLOR=#FFFBF0 LINK=#000000 ALINK=#008000 VLINK=#800080>
    <H2>List of Collections on $[dwGetUrlServer]</H2>
    <HR>
    $[dwSet ShowingRootCollection 0]
    $[dwCall Generic__GenerateCollectionViewBody]
    <HR>
  </BODY>
</HTML>
}

Template Contents

Some of the differences between DynaWeb templates and normal HTML documents include:

Configuration Files

This is a list of the configuration files that contain the templates you will need to modify in order to accomplish any of the changes mentioned in this chapter. Following each configuration file are the names of the templates contained in that file. The configuration files for DynaWeb are located in the data/config directory.

bookbbar.dwc

Frames__BookButtonBarTemplate
NoFrames__BookButtonBarTemplate

bookprnt.dwc

Generic__BookPrintView
Form__PrintTitleTocLine
Form__PrintTocLine
Form__PrintSpoolers
Generic__PrintError

bookqrs.dwc

Generic__QueryFormView
Generic__GenerateOneQueryForm

bookscpt.dwc

Generic__InlineHtml
Tables__InlineHtmlWithSearchHit
Tables__InlineHtmlWithHotSearchHit
Generic__InlineHtmlWithSearchHit

booktext.dwc

Frames__BookTextView
NoFrames__BookTextView

booktoc.dwc

Frames__BookTocView
NoFrames__BookTocView

bookview.dwc

Frames__BookView

collbbar.dwc

Frames__CollectionButtonBarView
NoFrames__CollectionButtonBarView

collmgr.dwc

Generic__CMSplash
Frames__CMViewTemplate
Generic__CMTocView
ContentPageScript
Frames__CMButtonBarView
NoFrames__CMButtonBarView

colltext.dwc

Generic__CollectionTextTemplate

colltoc.dwc

Generic__CollectionTocTemplate
Tables__CollectionTocLine

collview.dwc

NoFrames__CollectionView
Frames__CollectionView

prefs.dwc

ParsePrefs
BookLevelPrefs

rootview.dwc

Frames__RootView
Generic__Splash
NoFrames__RootView
Frames__RootCollectionView
NoFrames__RootCollectionView

tocutil.dwc

Tables__ExpandedTocLineTableRow
Tables__ExpandableTocLineTableRow
Tables__ElidedTocLineTableRow
Tables__NonExpandableTocLineTableRow

When using any of the procedures below, check this list to determine which file contains the templates you will have to modify. You may use any text editor to make changes to the configuration files.


   General Information   [Table of Contents]    URL Components