NAME

  search.pl - CGI script for searching for articles.


DESCRIPTION

This is the basic search engine for BSE. It uses search.tmpl (generated from search_base.tmpl) to format it's result pages.


TAGS

Please note that these tags are replace once the actual search is done. The tags defined in Base tags in the templates manpage are replaced when you choose Generate static pages from the admin page.

iterator ... results

Iterates over the articles for the current page of results.

result field

Access to fields in the current search result article.

date which field

Formats the given field of the tag which for display as a date.

keywords

Keywords for the current result article, if any keywords matches the requested search.

ifResults

Conditional tag, true if the search found any matching articles.

ifSearch

Conditional tag, true if the user entered any search terms.

dateSelected datevalue

The date value chosen by the user for the last search. Used in a <select> HTML tag to have the date field select the last value chosen by the user.

excerpt

An excerpt of the body of the current search result, with search terms highlighted.

articleurl

A link to the current search result article, taking admin mode into account.

count

The total number of matches found.

ifMultiple

Conditional tag, true if more than one match was found. This can be used to improve the wording of descriptions of the search results.

terms

The entered search terms.

resultSeq

The number of the current search result (ie. the first found is 1, etc).

list

A drop-down list of searchable sections.

iterator ... pages

Iterates over page numbers of search results.

page

The current page number within the page number iterator.

ifCurrentPage

Conditional tag, true if the page in the page number iterator is the displayed page of search results. This can be used for formatting the current page number differently (and not making it a link.)

pageurl

A link to the current page in the page number iterator.

An example

 ...
 <input type=text name=s value="<:terms:>">
 ...
 <:if Search:>
 <:if Results:>
  <dl>
  <:iterator begin results:>
  <dt><:resultSeq:> <a href="<:result url:>"><:result title:></a>
  <dd><:excerpt:>
  <:iterator end results:>
  </dl>
  <:iterator begin pages:>
   <:if CurrentPage:>
    <b><:page:></b>
   <:or CurrentPage:>
    <a href="<:pageurl:>"><:page:></a>
   <:eif CurrentPage:>
  <:iterator separator pages:>
  |
  <:iterator end pages:>
 <:or Results:>
 No articles matches your search.
 <:eif Results:>
 <:or Search:>
 <:eif Search:>