Revisions for SearchPage
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>
<h2>Pages matching your search:</h2>
<form method="POST" action="SearchPage">
<input type="hidden" name="source" value="search">
<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></p>
<br><br>
<h3>Search Again:</h3>
<input name="expr" type="text" size="30" value="<dtml-var expr>">
<input type="submit" name="submit" value="Search">
<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></p>
</dtml-if>
</dtml-in>
</dtml-comment>
</form>
<dtml-else>
<!-- Wiki Web search -->
<h2>Search <dtml-var "aq_parent.title"></h2>
<p>Type a search expression and hit enter to search the entire site. The
expression is case-insensitive and spaces are preserved. Leave it blank to
list all pages.</p>
<form method="POST" action="SearchPage">
<strong></strong> <input name="expr" type="text" size="30">
<input type="submit" name="submit" value="Search">
</form>
</dtml-if>
<br><br>
<!-- Google Search -->
<h3>Search with Google</h3>
<table cellpadding="5" cellspacing="0" width="65%">
<tr>
<td width="20%" class="sansNormal"><a href="http://www.google.com">Pages</a>:</td>
<td width="80%">
<form method="GET" action="http://www.google.com/search">
<input type="TEXT" name="q" size="20" value="<dtml-var expr missing>">
<input type="submit" value="Search">
</form>
</td>
</tr>
<tr>
<td class="sansNormal"><a href="http://images.google.com">Images</a>:</td>
<td>
<form method="get" action="http://images.google.com/images">
<input type="hidden" name="safe" value="on">
<input type="hidden" name="imgsafe" value="on">
<input type="text" name="q" size="20" value="<dtml-var expr missing>">
<input type="submit" value="Search">
</form>
</td>
</tr>
<tr>
<td class="sansMedium"><a href="http://news.google.com">News</a>:</td>
<td>
<form method="GET" action="http://news.google.com/news">
<input type="TEXT" name="q" size="20" value="<dtml-var expr missing>">
<input type="submit" value="Search">
</form>
</td>
</tr>
<tr>
<td class="sansNormal"><a href="http://groups.google.com">Usenet</a>:</td>
<td>
<form method="get" action="http://groups.google.com/groups">
<input type="text" name="q" size="20" value="<dtml-var expr missing>">
<input type="submit" value="Search">
</form>
</td>
</tr>
</table>
<!-- Merriam-Webster search -->
<h3>Word Search with Merriam Webster</h3>
<table cellpadding="5" cellspacing="0" width="65%">
<tr>
<td class="sansNormal" width="20%"><a href="http://www.m-w.com/">Definition</a>:</td>
<td width="80%">
<form method="post" action="http://www.m-w.com/cgi-bin/dictionary">
<input type="hidden" name="book" value="Dictionary">
<input type="text" name="va" size="20" value="<dtml-var expr missing>">
<input type="submit" value="Search">
</form>
</td>
</tr>
<tr>
<td class="sansNormal"><a href="http://www.m-w.com/">Synonym</a>:</td>
<td>
<form method="post" action="http://www.m-w.com/cgi-bin/thesaurus">
<input type="hidden" name="book" value="Thesaurus">
<input type="text" name="va" size="20" value="<dtml-var expr missing>">
<input type="submit" value="Search">
</form>
</td>
</tr>
</table>