[Pmwiki-users] An idea before I forget: Search form in the search results page

Patrick R. Michaud pmichaud
Tue Jan 6 09:13:48 CST 2004


On Tue, Jan 06, 2004 at 10:19:23AM +0100, Christian Ridderstr?m wrote:
> I just wondered why there is no search form on the page with the results 
> of a search.. as it is now, you have to go back to the previous page in 
> order to search again.

I don't remember exactly why I didn't put a search form on the search
results page, but I think I had a reason at the time.  At any rate, it's
easy to add--just set $PageSearchFmt in local.php to include a search 
from.  I tried the following on pmichaud.com and it worked:

$PageSearchFmt = "<h1>\$WikiImg $[Search Results]</h1>
  <form action='\$PageUrl' method='get'><input 
  type='hidden' name='action' value='search' /><input type='text'
  name='text' value='$text' size='40' /><input type='submit'
  value='$[Search]' /></form>
  $[SearchFor]
  <p /><dl>\$MatchList</dl>
  <p />$[SearchFound]
  <hr /><small>
  <a href='\$ScriptUrl/$[PmWiki/WikiHelp]'>$[WikiHelp]</a> -
  <a href='\$ScriptUrl/$[Main/SearchWiki]'>$[SearchWiki]</a><br />
  $[Search performed on \$LastModified]</small>";

This is the same as the normal $PageSearchFmt string except it
adds the <form ...>...</form> to prompt for a new search in the
search results.

Pm




More information about the pmwiki-users mailing list