Chapter 7. Template Sections

Table of Contents
Each section in detail
Embedded TCL

The ZAP template consists of a number of sections. Each section, with a couple of exceptions, should contain the HTML fragment, which is to be output when a given situation arises. However, the def and override sections contain input parameters which are not directly output, and the record section sometimes uses special syntax to govern the formatting of a given record structure (e.g. GRS-1). Each section is headed by a %% in the leftmost column, followed by the name of the section (e.g., "%%begin").

Each section in detail

The sections are executed in the order depicted in figure 1. First the %%def, %%override and %%begin sections are interpreted. If the query is valid the search is performed and this will result in either the %%server-error or the %%server-hits section is executed. This procedure is repeated for each target. If the search results in any hits the %%records begin is executed and then for each record the %%record xxx and %%format xxx (where xxx is the record format the records are returned from the server in) is executed. Finally the %%end section is executed.

%%sort-record

This section should return the sort key for a record. It is only invoked if sorting is enabled. See the Section called servertotal in Chapter 5 This section is similar to %%record but should not make output. Upon completion of this section, ZAP inspects the TCL variable sort and assumes it is the sorting key.

%%sort-format

This section should return the sort key for a record. It is only invoked if sorting is enabled. See the Section called servertotal in Chapter 5 This section similar to %%format but should not make output. Upon completion of this section, ZAP inspects the TCL variable sort and assumes it is the sorting key.