  
	
  
  
	
	  htsearch
	
	
	  ht://Dig Copyright © 1995-2004 
THANKS.htmlThe ht://Dig Group 	  Please see the file 
COPYINGCOPYING  for
	  license information.
	
	
	
	  Output Templates
	
	
	  The htsearch 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:
	
	
	  
		
attrs.html#search_results_header		search_results_header
	  
	  
		
attrs.html#search_results_footer		search_results_footer
	  
	  
		
attrs.html#search_results_wrapper		search_results_wrapper
	  
	  
		
attrs.html#nothing_found_file		nothing_found_file
	  
	  
		
attrs.html#syntax_error_file		syntax_error_file
	  
	
	
	  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 
attrs.html#template_maptemplate_map  configuration
	  file attribute. This attribute contains a list of strings
	  triplets. For each triplet of strings, the elements have the
	  following meaning:
	
	
	  
		the name that will appear in the FORMAT menu (see below)
	  
	  
		the internal name used by htsearch for this result template
	  
	  
		the base filename for the template.
	  
	
	
	  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 \
	  Short builtin-short builtin-short
	
	
	  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 files
	
	
	  When 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 
http://hoohoo.ncsa.uiuc.edu/cgi/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:
	
	
	  
		
ANCHOR		(Only in matchTemplate)
	  
	  
		Expands to the named anchor found just before the first match; it
		includes "#" at the start so it can be directly appended to the URL
		variable. If no anchor was found, ANCHOR is empty.
	  
	  
		
BACKLINKS		(Only in matchTemplate)
	  
	  
		The number of links 
to the current match.
	  
	  
		
CGI 	  
	  
		Unless the configuration file sets a different value,
		this expands to whatever the SCRIPT_NAME environment
		variable is. See the
		
attrs.html#script_namescript_name 		configuration file attribute for more information.
	  
	  
		
CONFIG	  
	  
		The 
hts_form.html#configconfiguration file .
	  
	  
		
CURRENT		(Only in matchTemplate)
	  
	  
		The number of the current match.
	  
	  
	        
DESCRIPTION 		(Only in matchTemplate)
	  
	  
		The first URL description for the matched document.  See below.
	  
	  
	        
DESCRIPTIONS 		(Only in matchTemplate)
	  
	  
		A list of 
attrs.html#description_factorURL text
		descriptions
 for the matched document. The
		entries in the list are separated by <br>. These are the
		text used between the <a href...> and </a>tags.
		These are controlled by the
		
attrs.html#max_descriptionsmax_descriptions  and
		
attrs.html#max_description_lengthmax_description_length 		configuration attributes.
	  
	  
		
DOCID		(Only in matchTemplate)
	  
	  
		The internal ID for the document for the current match.
	  
	  
		
EXCERPT		(Only in matchTemplate)
	  
	  
		The relevant 
attrs.html#excerpt_show_topexcerpt 		for the current match.
	  
	  
		
EXCLUDE	  
	  
		A 
hts_form.html#excludelist of words excluded 		from the search, separated by '|'.
	  
	  
		
FIRSTDISPLAYED	  
	  
		The index of the first match on this page.
	  
	  
		
FORMAT	  
	  
		Expands to an HTML menu of all the available formats. The
		current format will be the default one.
		The menu is composed of choices itemized in the
		
attrs.html#template_maptemplate_map 		attribute. The expansion of this template variable is
		described in more detail in the
		
hts_selectors.htmlselect list documentation .
	  
	  
		
HOPCOUNT		(Only in matchTemplate)
	  
	  
		The distance of this match away from the starting
		document(s).
	  
	  
		
KEYWORDS	  
	  
		A string of the search keywords with spaces in between, as
		specified in the
		
hts_form.html#keywordskeywords input
		parameter
.
	  
	  
		
LASTDISPLAYED	  
	  
		The index of the last match on this page.
	  
	  
	  
LOGICAL_WORDS 	  
	  
		A string of the 
hts_form.html#wordssearch words 		with "and", "or" or "not" between the words, depending on the
		
hts_form.html#match_methodtype of search .
		(These values are overridden by the
		
attrs.html#boolean_keywordsboolean_keywords 		attribute.)
	  
	  
		
MATCH_MESSAGE	  
	  
		This is either 
all or any depending on
		the 
hts_form.html#match_methodmatch method  used.
		(These values are overridden by the
		
attrs.html#method_namesmethod_names 		attribute.)
	  
	  
		
MATCHES	  
	  
		The total number of matches that were found.
	  
	  
		
MATCHES_PER_PAGE 	  
	  
		The configured 
hts_form.html#matchesperpagemaximum
		number of matches
 on this page.
	  
	  
		
MAX_STARS	  
	  
		The configured 
attrs.html#max_starsmaximum number
		of stars
 to display in matches.
	  
	  
	        
METADESCRIPTION 		(Only in matchTemplate)
	  
	  
		The meta description text (if any) for the matched document.
	  
	  
		
METHOD	  
	  
		Expands to an HTML menu of all the available matching
		methods. The current method will be the default one.
		The menu is composed of choices itemized in the
		
attrs.html#method_namesmethod_names 		attribute. The expansion of this template variable is
		described in more detail in the
		
hts_selectors.htmlselect list documentation .
	  
	  
		
MODIFIED		(Only in matchTemplate)
	  
	  
		The date and time the document was last modified
	  
	  
		
NEXTPAGE	  
	  
		This expands to the value of the
		
attrs.html#next_page_textnext_page_text  or
		
attrs.html#no_next_page_textno_next_page_text 		attributes depending on whether there is a next page or not.
		If there is only one page of output, this is empty, regardless
		of the setting of no_next_page_text.
	  
	  
		
NSTARS	  
	  
	       The number of stars calculated for this document as an
	       integer, up to a maximum specified by the 
attrs.html#max_starsmax_stars  attribute.
	  
	  
		
PAGE	  
	  
		The current page number.  Equal to the
		
hts_form.html#pagepage  CGI argument, or 1 by
		default.
	  
	  
		
PAGEHEADER	  
	  
		This expands to either the value of the
		
attrs.html#page_list_headerpage_list_header  or
		
attrs.html#no_page_list_headerno_page_list_header 		attributes depending on how many pages there are.
	  
	  
		
PAGELIST	  
	  
		This expands to a list of hyperlinks using the
		
attrs.html#page_number_textpage_number_text  and
		
attrs.html#no_page_number_textno_page_number_text 		attributes.  For the current page, it displays
		no_page_number_text without a hyperlink.  Other pages have a
		hyperlink, and use page_number_text.
	  
	  
		
PAGES	  
	  
		The total number of pages.
	  
	  
		
PERCENT		(Only in matchTemplate)
	  
	  
		The match score as a percentage. Its range is 1 to 100,
		without a percent sign. The minimum is always 1 so the
		variable can be used as the value for an HTML WIDTH
		attribute.
	  
	  
		
PLURAL_MATCHES	  
	  
		If the 
MATCHES variable is other than 1, this
		will be a single 's'.
		(This value is overridden by the
		
attrs.html#plural_suffixplural_suffix 		attribute.)
	  
	  
		
PREVPAGE	  
	  
		This expands to the value of the
		
attrs.html#prev_page_textprev_page_text  or
		
attrs.html#no_prev_page_textno_prev_page_text 		attributes depending on whether there is a previous page or not.
		If there is only one page of output, this is empty, regardless
		of the setting of no_prev_page_text.
	  
	  
		
RESTRICT	  
	  
		The 
hts_form.html#restrictlist of patterns  which
		must be matched by the returned URLs, separated by '|'.
	  
	  
		
SCORE		(Only in matchTemplate)
	  
	  
		The score of the current match
	  
	  
		
SELECTED_FORMAT 	  
	  
		The currently selected 
hts_form.html#formatformat .
	  
	  
		
SELECTED_METHOD 	  
	  
		The currently selected 
hts_form.html#methodmatching
		method
.
	  
	  
		
SELECTED_SORT 	  
	  
		The currently selected 
hts_form.html#sortsorting
		method
.
	  
	  
		
SIZE		(Only in matchTemplate)
	  
	  
		The size of the document for the current match
	  
	  
		
SIZEK		(Only in matchTemplate)
	  
	  
		The size in kilobytes of the document for the current match
	  
	  
		
SORT	  
	  
		Expands to an HTML menu of all the available sorting
		methods. The current method will be the default one.
		The menu is composed of choices itemized in the
		
attrs.html#sort_namessort_names 		attribute. The expansion of this template variable is
		described in more detail in the
		
hts_selectors.htmlselect list documentation .
	  
	  
		
STARSLEFT		(Only in matchTemplate)
	  
	  
		A set of HTML <img> tags with the
		
attrs.html#star_imagestars  aligned on the left.
	  
	  
		
STARSRIGHT		(Only in matchTemplate)
	  
	  
		A set of HTML <img> tags with the stars
		
attrs.html#star_imagestars  aligned on the right.
	  
	  
		
STARTYEAR, STARTMONTH, STARTDAY,
		
ENDYEAR, ENDMONTH, ENDDAY	  
	  
		The currently specified 
hts_form.html#startyeardate
		range
 for restricting search results.
	  
	  
	  
SYNTAXERROR		(Only in
		
attrs.html#syntax_error_filesyntax_error_file )
	  
	  
		Is the text of the boolean expression syntax error.
	  
	  
		
TITLE		(Only in matchTemplate)
	  
	  
		The title of the document for the current match
	  
	  
		
URL		(Only in matchTemplate)
	  
	  
		The URL to the document for the current match
	  
	  
		
VERSION	  
	  
		The ht://Dig 
attrs.html#versionversion number .
	  
	  
		
WORDS	  
	  
		A string of the 
hts_form.html#wordssearch words 		with spaces in between.
	  
	
	
	Last modified: $Date: 2004/05/28 13:15:18 $
  
