search.pl - CGI script for searching for articles.
This is the basic search engine for BSE. It uses search.tmpl (generated from search_base.tmpl) to format it's result pages.
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.
Iterates over the articles for the current page of results.
Access to fields in the current search result article.
Formats the given field of the tag which for display as a date.
Keywords for the current result article, if any keywords matches the requested search.
Conditional tag, true if the search found any matching articles.
Conditional tag, true if the user entered any search terms.
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.
An excerpt of the body of the current search result, with search terms highlighted.
A link to the current search result article, taking admin mode into account.
The total number of matches found.
Conditional tag, true if more than one match was found. This can be used to improve the wording of descriptions of the search results.
The entered search terms.
The number of the current search result (ie. the first found is 1, etc).
A drop-down list of searchable sections.
Iterates over page numbers of search results.
The current page number within the page number iterator.
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.)
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:>