hl://Dig htsearch General HTML form Templates Search method |
Output TemplatesThe hlsearch program will normally produce HTML output. In this process it makes extensive use of template in which variables will be substituted. The templates are specified in the configuration file. The configuration file attributes defining these templates are:
In addition to these files, the search results are also produced with the use of templates. The result templates are a bit more complicated because they can be specified at runtime using an HTML menu. They are specified using the template_map configuration file attribute. This attribute contains a list of strings triplets. For each triplet of strings, the elements have the following meaning:
There are two predefined templates that are used by default. They have the internal names builtin-long and builtin-short. As such, the default value for the template_map attribute is as follows: Long builtin-long builtin-long \ Which means that there will be two ways to display the search results: a "Long" and a "Short" way. The first template listed will always be the default one for the first search. Thereafter, the default will be whatever was selected for the previous search. Result template filesWhen a custom template is required, one or more template files need to be created and referenced in the template_map attribute. These templates are user-selectable from the search form. It is also possible to select result templates based on URL patterns of the search matches, using the template_patterns attribute. This allows distinct visual styles to be used for matches on different web sites. There are many variables that can be substituted into these templates. Not all of them make sense for each file, so not all of them will be substituted for every file, as noted below. In addition, all of the standard CGI environment variables are available, and listed in the cgi specification. Variables will be substituted normally with the format $(VAR), escaped for use in a URL with the format $%(VAR), URL-encoding decoded with the format $=(VAR), and HTML-escaped with the format $&(VAR). The variables are:
|