Go to the previous topic.    Go to the next topic.

Setting up search and result pages

Before you can deploy ht://Dig, you are encouraged to edit its page templates to conform to the look-and-feel of your website. Those page templates include:

../htdig/search.html

The default search page with option lists to control sort order, boolean settings, and format (long or short). If you prefer, you may simply add a form to one of your existing website pages to interface with the ht://Dig database.

../htdig/common/footer.html

The template that formats the page previous, page list and page next links at the bottom of the search results page.

../htdig/common/header.html

The template used to render the results page when matches are found.

../htdig/common/long.html

The template used to format long result returns. Long results include page titles and snippets of the body text where matches were found, with matches shown in bold.

../htdig/common/nomatch.html

The template used when a search does not find any matching documents.

../htdig/common/short.html

The template used to format short result returns. Short results only show page titles.

../htdig/common/syntax.html

The template used to display an error message when the user enters a search string that does not follow the defined ht://Dig search syntax.

Each one of these page templates include htdig variables which appear in the following format:

$&(VARIABLE)

You are free to change where these variables appear within a given template (just be careful not to edit them in any way).

Note: As our servers parse all documents as PHP, you are free to use PHP include files within (or in lieu of) the default ht://Dig templates.

To add a search form:

Do one of the following:

<form method="post" action="/cgi-bin/htsearch">
	<input type="hidden" name="config" value="htdig">
	<input type="hidden" name="restrict" value="">
	<input type="hidden" name="exclude" value="">
	<input type="text" size="20" name="words" value="">
	<input type="submit" value="Search">
</form>

To customize the results page:

Edit the relevant ht://Dig templates listed above.