13.1 Customizing Templates

You can extend the capabilities of QuickFinder Server by customizing the templates.

The first step is to determine which components of QuickFinder you want to customize. For example, if you only want to add a few additional search features to the search page template and modify its background color and table size, you would modify the SearchTemplate.html or SearchTemplate.Simple files.

This section discusses how to customize the search, print, and result templates and how to use available parameters and variables to create a customized search solution.

13.1.1 Customizing the Search Templates

You can customize the design and functionality of the static or dynamic search templates by

  • Modifying HTML code

  • Adding or removing search parameters

If you are familiar with HTML, you can quickly modify the design of the default (dynamic) search template or the static search template. For example, you can change the colors of the search page or add new custom graphics.

To modify the functionality of the default search template, you can add or remove search parameters. Search parameters are used to communicate with QuickFinder. By embedding them in the correct places in your HTML source, you can extend or limit the functionality of the default search template.

For example, if you wanted your users to use a specific set of templates found in a themes directory, you would add the following HTML code, including the theme parameter, to the SearchTemplate.html file:

<INPUT TYPE=”Hidden” NAME=”theme” VALUE=”$$QueryTemplateTheme”>

This sample HTML code tells QuickFinder to look for templates only in the specified template directory. All themes are located within the templates directory specified in QuickFinder Server Manager.

For a complete list of available search parameters, see Section 12.12, Search Parameters.

13.1.2 Customizing Search Result Templates

QuickFinder Server includes several default search result templates that are used to display hits, provide feedback to a user, or request information from a user after a search is performed. For more information about the default search result templates, see Section 11.0, Understanding Templates.

You can customize the design and functionality of the default search result template, which is the template used when a user selects Normal from the Result List Format drop-down list in the QuickFinder form. For information about how to access the QuickFinder form, see Section 1.5, Taking a Test Run: Performing a Search.

Customizing the default search result template involves

  • Modifying the HTML code

  • Adding or removing search result variables

If you are familiar with HTML, you can quickly modify the design of the default search result template. For example, you can change the colors of the search page or add new graphics.

To modify the functionality of the default search result template, you can add or remove search result variables. Search result variables are placed in the template where you want search results to be displayed.

For example, if you want to display the total number of hits returned when a user performs a search and you want the information to appear in the upper left corner of the search results page, you would add the following HTML code to the search result template file:

Total Search Results: $$TotalHits 

After a user performs a search, the $$TotalHits variable is replaced by the actual total number of hits found during the search.

The $$TotalHits variable is used to retrieve the total number of hits found during a search. You can place this variable anywhere in the results list template to organize the display of information in the way you want.

Default search result templates are located in volume:\searchroot\TEMPLATES\. For a complete list of search result variables that you can use to customize default search result templates or to create new ones, see Section 12.6, Search Result Variables.

13.1.3 Customizing Print Result Templates

Print result templates are used to organize and format search results for printing and to provide feedback to a user when no hits are found. QuickFinder Server includes two default print result templates: the default print result template and a “no hits” template.For more information about the default print result templates, see Section 11.0, Understanding Templates.

You can customize the design and functionality of the default print result template in the same way you customize the search result template:

  • Modifying the HTML code

  • Adding or removing print result variables

If you are familiar with HTML, you can quickly modify the design of the default print result template. For example, you can change the colors of the print results page or add new graphics to it.

To modify the functionality of the default print result template, you can add or remove print result variables. Variables are placed in the template where you want search results to be displayed.

For example, if you wanted to remove the table of contents from the default print result template, you would remove, or comment out, the following HTML code in the PRINTRESULTLIST.HTML template, which would include the $$BeginTOCList variable:

<CENTER><H2>Table of Contents</H2></CENTER><p><!--            TABLE OF CONTENTS                   - >$$BeginTOCList[<BIG><B>$$Product</B></BIG><DL>]<DT><A HREF=”#$$Bookmark”><BIG>$$Title</BIG></A><SPACER TYPE=HORIZONTAL SIZE=20><I><SMALL>[$$URL]</SMALL></I>$$EndTOCList[</DL>]

You could either save your changes in the default print result list template or you could save it with a new name, thereby creating an alternative template for users who don't want a table of contents in the print results. For the template to be effective, you would then need to add a hypertext link in the search result template that would include the &template=new_template_name query parameter.

Default print result templates can be found at volume:\searchroot\templates. For a complete list of print result variables that you can use to customize default search result templates or to create new ones, see Section 12.7, Print Result Variables.

13.1.4 Customizing Error and Response Message Templates

Error and response messages are used to either provide feedback to the user or to request information from the user.

Error and response message templates are used to display the content of error and response messages sent by the QuickFinder Server in response to search or print errors. Similar to search and print templates, error and response templates can be customized. However, because the contents of error and response messages are built into QuickFinder Server, you cannot modify the contents of the messages or the button objects that might appear, depending on the type of response being generated.

Customizing Error Messages

There are several error messages that can be returned to a user. For example, when users incorrectly use a search operator in a search form, they might get the message, Search Error: Incorrect use of Boolean operator. An error number might also appear.

Although you can use HTML tags to format an error message, add or remove variables to determine what information is shown to the user, or even reorganize where the messages appear in the template, you cannot modify the message itself.

Customizing Response Messages

The same concepts apply to response messages, but response messages return buttons that a user can click. Which buttons appear are determined by the QuickFinder Server. Although you can modify the labels of these buttons, you cannot determine which buttons appear, or when.