Template Variables
Each section consists of HTML formatted text with special meta symbols. Every meta symbol is replaced by its corresponding string. You can think of meta symbols as of variables, which will have their appropriate values while displaying search results.
Format of variables is the following:
$(x) - plain value
$&(x) - HTML-escaped value
$%(x) - value escaped to be used in URLs
Template sections
The following section names are defined:
TOP - This section is included first on every page. You should begin this section with <HTML><HEAD> and so on. Also, this is a definitive place to provide a search form. There are two special meta symbols you may use in this section:
$(self) - argument for FORM ACTION tag
$(q) - a search query
$(ndocs) - total number of documents in the database
$(cat) - current category value
$(g) - current tag value
$(rN) - random number (here N is a number)
If you want to include some random banners on your pages, please use $rN. You should also place string like "RN xxxx" in variables section (see below), which will give you a range 0..xxxx for $rN. You can use as many up random numbers as you want.
Example: $(r0), $(r1), $(r45) etc
Simple top section should be like this:
There are some variables defined in FORM.
ul is the filter for URL. It allows you to limit results to particular site or section etc. For example, you can put the following in the form
Search through:
<SELECT NAME="ul">
<OPTION VALUE="" SELECTED="$(ul)">Entire site
<OPTION VALUE="/manual/" SELECTED="$(ul)">Manual
<OPTION VALUE="/products/" SELECTED="$(ul)">Products
<OPTION VALUE="/support/" SELECTED="$(ul)">Support
</SELECT>
to limit your search to particular section.
The expression SELECTED="$(ul)" in example above (and all the examples below) allows the selected option to be reproduced on next pages. If search front-end finds that expression it prints the string SELECTED only in the case OPTION VALUE given is equal to that variable.
ps is default page size (e.g. how many documents to display per page).
q is the query itself.
pn is ps*np. This variable is not used by mnoGoSearch, but may be useful for example in <!INCLUDE CONTENT="..."> directive if you want to include result produced by another search engine.
Following variables are concerning advanced search capabilities:
m can be used to choose default search type if your query consists of more than one word. In case m=any, the search will try to find at least one word, in case m=all, the search is more restrictive - all words should be in the document. If m=bool query string is considered as a boolean expression.
o is used to specify the output format, so user can select different formats. There are three formats in default search.htm-dist for "res" section. They are used to output documents information in "Long", "Short" and "URL only" representation. However, you may use several formats for all sections, not for "res" only.
dt is time limiting type. There are three types supported.
If 'dt' is 'back', that means you want to limit result to recent pages, and you should specify this "recentness" in variable 'dp' in the form xxxA[yyyB[zzzC]]. Spaces are allowed between xxx and A and yyy and so on). xxx, yyy, zzz are numbers (can be negative!) A, B, C can be one of the following (the letters are the same as in strptime/strftime functions):
s - second
M - minute
h - hour
d - day
m - month
y - year
Examples:
4h30m - 2 hours and 30 minutes
1Y6M-15d - 1 year and six month minus 15 days
1h-60m+1s - 1 hour minus 60 minutes plus 1 second
If 'dt' is 'er' (which is short for newer/older), that means the search will be limited to pages newer or older than date given. Variable dx is newer/older flag (1 means "newer" or "after", -1 means "older" or "before"). Date is separated into fields as follows:
'dm' - month (0 - January, 1 - February, .., 11 - December)
'dy' - year (four digits, for example 1999 or 2000)
'dd' - day (1...31)
If 'dt' is 'range', that means search within given range of dates. Variables 'db' and 'de' are used here and stands for beginning and end date. Each date is string in the form dd/mm/yyyy, there dd is day, mm is month and yyyy is four-digits year.
This is the example of FORM part where you can choose between different time limiting options.
<!-- 'search with time limits' options -->
<TR><TD>
<TABLE CELLPADDING=2 CELLSPACING=0 BORDER=0>
<CAPTION>
Limit results to pages published within a specified
period of time.<BR>
<FONT SIZE=-1><I>(Please select only one option)
</I></FONT>
</CAPTION>
<TR>
<TD VALIGN=center>
<INPUT TYPE=radio NAME="dt" VALUE="back" CHECKED>
</TD>
<TD><SELECT NAME="dp">
<OPTION VALUE="0" SELECTED="$(dp)">anytime
<OPTION VALUE="10M" SELECTED="$(dp)">in the last ten minutes
<OPTION VALUE="1h" SELECTED="$(dp)">in the last hour
<OPTION VALUE="7d" SELECTED="$(dp)">in the last week
<OPTION VALUE="14d" SELECTED="$(dp)">in the last 2 weeks
<OPTION VALUE="1m" SELECTED="$(dp)">in the last month
<OPTION VALUE="3m" SELECTED="$(dp)">in the last 3 months
<OPTION VALUE="6m" SELECTED="$(dp)">in the last 6 months
<OPTION VALUE="1y" SELECTED="$(dp)">in the last year
<OPTION VALUE="2y" SELECTED="$(dp)">in the last 2 years
</SELECT>
</TD>
</TR>
<TR>
<TD VALIGN=center><INPUT type=radio NAME="dt" VALUE="er">
</TD>
<TD><SELECT NAME="dx">
<OPTION VALUE="1" SELECTED="$(dx)">After
<OPTION VALUE="-1" SELECTED="$(dx)">Before
</SELECT>
or on
<SELECT NAME="dm">
<OPTION VALUE="0" SELECTED="$(dm)">January
<OPTION VALUE="1" SELECTED="$(dm)">February
<OPTION VALUE="2" SELECTED="$(dm)">March
<OPTION VALUE="3" SELECTED="$(dm)">April
<OPTION VALUE="4" SELECTED="$(dm)">May
<OPTION VALUE="5" SELECTED="$(dm)">June
<OPTION VALUE="6" SELECTED="$(dm)">July
<OPTION VALUE="7" SELECTED="$(dm)">August
<OPTION VALUE="8" SELECTED="$(dm)">September
<OPTION VALUE="9" SELECTED="$(dm)">October
<OPTION VALUE="10" SELECTED="$(dm)">November
<OPTION VALUE="11" SELECTED="$(dm)">December
</SELECT>
<INPUT TYPE=text NAME="dd" VALUE="$(dd)" SIZE=2 maxlength=2>
,
<SELECT NAME="dy" >
<OPTION VALUE="1990" SELECTED="$(dy)">1990
<OPTION VALUE="1991" SELECTED="$(dy)">1991
<OPTION VALUE="1992" SELECTED="$(dy)">1992
<OPTION VALUE="1993" SELECTED="$(dy)">1993
<OPTION VALUE="1994" SELECTED="$(dy)">1994
<OPTION VALUE="1995" SELECTED="$(dy)">1995
<OPTION VALUE="1996" SELECTED="$(dy)">1996
<OPTION VALUE="1997" SELECTED="$(dy)">1997
<OPTION VALUE="1998" SELECTED="$(dy)">1998
<OPTION VALUE="1999" SELECTED="$(dy)">1999
<OPTION VALUE="2000" SELECTED="$(dy)">2000
<OPTION VALUE="2001" SELECTED="$(dy)">2001
</SELECT>
</TD>
</TR>
<TR>
<TD VALIGN=center><INPUT TYPE=radio NAME="dt" VALUE="range">
</TD>
<TD>
Between
<INPUT TYPE=text NAME="db" VALUE="$(db)" SIZE=11 MAXLENGTH=11>
and
<INPUT TYPE=text NAME="de" VALUE="$(de)" SIZE=11 MAXLENGTH=11>
</TD>
</TR>
</TABLE>
</TD></TR>
<!-- end of stl options -->
»
|