Edit detail for SearchPage revision 3 of 1

3
Editor: alexander.s.reynaud.1
Time: 2017/09/21 01:11:26 GMT-4
Note:

changed:
-
<dtml-if "_.has_key('expr')">

<dtml-if "_.has_key('source') and source == 'jump'">
  <dtml-comment>
  we are doing a jump
  </dtml-comment>
  <dtml-if "expr == ''">
    <dtml-comment>blank expr - jump to front page
    <dtml-call "RESPONSE.redirect(URL1)"></dtml-comment>
    <dtml-comment>blank expr - let the search list all</dtml-comment>
  <dtml-elif "expr[0] == '!'">
    <dtml-comment>skip jumping, just do a search</dtml-comment>
    <dtml-call "REQUEST.set('expr',expr[1:])">
  <dtml-else>
    <dtml-comment>search for an id beginning with expr</dtml-comment>
    <dtml-in "aq_parent.objectValues(spec='ZWiki Page')" sort=id reverse>
      <dtml-if "_.string.find(_.string.lower(id()),_.string.lower(expr)) == 0">
        <dtml-comment>found one - jump there</dtml-comment>
        <dtml-comment>can't find url_quote</dtml-comment>
        <dtml-call "RESPONSE.redirect(URL1 + '/' + _.string.replace(id(),' ','%20'))">
      </dtml-if>
    </dtml-in>
  </dtml-if>
  <dtml-comment>no ids matched - fall through and do a search</dtml-comment>
</dtml-if>

<form method="POST" action="!SearchPage">
<input type="hidden" name="source" value="search">
!<strong>Search for:</strong> <input name="expr" type="text" size="30" value="<dtml-var expr>">
<input type="submit" name="submit" value="Search">
<br>
<strong>Results:</strong>
<br>
<br>
<dtml-call "REQUEST.set('count',0)">
<dtml-in "aq_parent.objectValues(spec='ZWiki Page')" sort=title_or_id>
  <dtml-unless "_.string.find(_.string.lower(_.getitem('sequence-item').raw),_.string.lower(expr)) == -1 and _.string.find(_.string.lower(id()),_.string.lower(expr)) == -1">
    <dtml-call "REQUEST.set('count',REQUEST.count + 1)">
    <!-- <a href="&dtml.url_quote-id;">&dtml-title_or_id;</a><br>-->
  </dtml-unless></dtml-in>
<p>
<strong><dtml-var count> hits</strong>

<dtml-comment>
<dtml-in "Catalog(text=expr)" sort=id>
    [<dtml-var id>]<br>
<dtml-if sequence-end>
<p>
<strong>(<dtml-var sequence-number> hits)</strong>
</dtml-if>
</dtml-in>
</dtml-comment>

</form>

<dtml-else>

<form method="POST" action="!SearchPage">
Type a search expression and hit enter to search the entire wikiweb. The
expression is case-insensitive and spaces are preserved. Leave it blank to
list all pages. 
<p>
<strong>Search for:</strong> <input name="expr" type="text" size="30">
<input type="submit" name="submit" value="Search">
</form>

</dtml-if>

<hr>
Some other likely search tools:
<p>
<div align="right">

<FORM METHOD="POST" ACTION="http://sunir.org/apps/meta.pl" ENCTYPE="application/x-www-form-urlencoded">
all wikis indexed by <a href="http://sunir.org/apps/meta.pl">Metawiki</a> 
(regexps allowed):
<INPUT TYPE="TEXT" NAME="words" size="30" value="<dtml-var expr missing>">
<INPUT TYPE="submit" VALUE="Search">
</FORM>

<FORM METHOD="GET" ACTION="http://www.google.com/search">
Google
(<a href="http://www.google.com/advanced_search">advanced</a>,
<a href="http://www.google.com/help/basics.html">help</a>):
<INPUT TYPE="TEXT" NAME="q"  size="30" value="<dtml-var expr missing>">
<INPUT TYPE="submit" VALUE="Search">
</FORM>

<FORM METHOD="GET" ACTION="http://groups.google.com/groups">
USENET via <a href="http://groups.google.com">groups.google.com</a>:
<INPUT TYPE="TEXT" NAME="q"  size="30" value="<dtml-var expr missing>">
<INPUT TYPE="submit" VALUE="Search">
</FORM>

<FORM METHOD="GET" ACTION="http://www.google.com/search?cat=gwd%2FTop&hl=%28null%29">
<a href="http://directory.google.com">directory.google.com</a> (ODP plus page ranking):
<INPUT TYPE="TEXT" NAME="q"  size="30" value="<dtml-var expr missing>">
<INPUT TYPE="submit" VALUE="Search">
</FORM>

<FORM METHOD="GET" ACTION="http://images.google.com/images">
<a href="http://images.google.com">images.google.com</a>:
<input type="hidden" name="safe" value="off">
<input type="hidden" name="imgsafe" value="off">
<INPUT TYPE="TEXT" NAME="q"  size="30" value="<dtml-var expr missing>">
<INPUT TYPE="submit" VALUE="Search">
</FORM>

</div>

we are doing a jump blank expr - jump to front page blank expr - let the search list all skip jumping, just do a search search for an id beginning with expr found one - jump there can't find url_quote no ids matched - fall through and do a search

Search for:
Results:

hits

[]?

( hits)

Type a search expression and hit enter to search the entire wikiweb. The expression is case-insensitive and spaces are preserved. Leave it blank to list all pages.

Search for:


Some other likely search tools:

all wikis indexed by Metawiki (regexps allowed):

Google (advanced, help):

USENET via groups.google.com:

directory.google.com (ODP plus page ranking):

images.google.com: