Template
Files
Purpose: Templates are used to define the
look of an interface and to guide the presentation of results, either a
query or a map, to the user. A template can be either a URL (eg. http://www.somewhere.com/[ATTRIBUTE]/info.html)
or HTML file(s). Simple pan/zoom interfaces use a single template file
while compilicated queries often require many templates. URL templates
can only be used with simple QUERY or ITEMQUERY results so many substitutions
defined below are not available.
Notes: Template substitution strings are
case sensitive. Attribute item substitutions must be the same case as the
item names in the dbase file. ArcView and ArcInfo generally produce dbase
files with item names that are all uppercase. Appropriate URL encoding
(i.e. ' ' to '+') is applied when templates are URLs.
Format: Templates are simply HTML files
or URL strings that contains special characters that are replaced by mapserv
each time the template is processed. The simple substitution allows information
such as active layers or the spatial extent to be passed from the user
to mapserv and back again. Most often the new values are dumped into form
variables that will be passed on again. The list of special characters
and form variables is given below. HTML templates can include just about
anything including javascript and java calls.