Customizing the Result Display
The search results table consists of 3 parts. Each of these parts are a template
which can be edited, and when put together create a complete table.
Search Results Header
- The header opens the table, and contains the column headings. This template will
end with the </tr> HTML tag.
Search Results Item
- The item template is used for each record being displayed. Generally the HTML will begin with <tr> and end with the </tr>
HTML tags.
Search Results Footer
- The footer template is used to close out the table with the </table> HTML tags.
Inserting the Data into the Search Result Templates
A replacement system is used to replace the data for a specific column with
a tag set in the template. This tag is created by adding the word FIELD (all in caps)
to a number assigned to each column relative to its order in the list
(1,2,3...beginning with 1) An example would then be: FIELD1, FIELD2, etc..
The program will replace the tag with the data when a match is found.
You will find a list of tags and what column they will display above
the template edit area in the Display HTML Settings section of your
manager.
You may place HTML around your tags as needed. An example where FIELD3 contained an email address and FIELD4 was a name:
Customizing the Search
Any form may also be constructed into a link as well. You will find examples
of how to construct a basic link to a specific column above
the template edit area in the Display HTML Settings section of your
manager.
A perfect use for something like this would be to treat a specific column as a category,
and organize your navigation like that. See
www.strictlymint.com/links. This may be a Link
Doctor implementation, but the principle is the same.
Available Fields for Creating Custom Search Forms and Links
- search: Required in all links. search=1 tells the program what to do.
- display_all: dispay_all=1 will display the entire database.
- column: You will a list of column names above
the template edit area in the Display HTML Settings section of your
manager.
- searchtext: searchtext=something will do a keyword search.
- searchtype: with any or all. searchtype=all means all all keywords must be ptresent.
- searchterms: See below.
Examples:
- display.cgi?search=1&display_all=1 will return the entire database.
- display.cgi?search=1&column=Description&searchtext=blue would search for the word blue, only in the column named Description.
When constructing your links, notice that everything starts after the script name with a ? and each set is separated by an &.
Any of these can be hidden fields in a regular form as well.
Custom Searching using Searchterms:
Searchterms are a way to add a custom search with multiple parameters. Basically this allows the viewer
to ask more than one question at a time. We can help them by making drop down lists of information that we know
exists in the database. In the example provided below, We are telling you that you can search by Year or Player.
We have given you lists that we know exist.
Using Searchterms, every selected parameter must exist for the result to be returned.
Here is the HTML for the form from the above search:
<form method=post action="http://www.gletech.com/testarea/dbdoctor/display.cgi"
target="_blank">
<SELECT NAME = "Year">
<OPTION>1974</option>
<OPTION>1976</option>
</select>
<SELECT NAME = "Player">
<OPTION>Gaylord Perry</option>
<OPTION>Jim Kaat</option>
</select>
<input type=hidden name="search" value="1">
<input type=hidden name="searchterms" value="Year,Player">
<input type=submit value="Search">
</form>
To create your own searchterm list, create the fields that you want to
be in your seach form. Name them whatever you like (without spaces though).
These fields can be any type of HTML -- drop downs, text input, checkboxes, radio buttons.
Then create a hidden field named searchterms and put all the names of the fields you created in
the value, separated by commas.
|