[Pmwiki-users] Searchbox conversion to Pmwiki2

John Rankin john.rankin
Wed Dec 8 14:16:44 CST 2004

On Wednesday, 8 December 2004 4:49 PM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>> - an action=search that displays the results in the current page,
>>   including a SearchQuickReference page (in other words, it behaves
>>   like Edit Page)
>This seems like it could be accomplished by modifying $GroupHeaderFmt,
>something like...
>if ($action=='search') {
>   $GroupHeaderFmt = '(:include
>$Group.GroupHeader:)(:nl:)(:include Main.SearchWiki:)(:nl:)';
>   $action = 'browse';
What if $pagename includes a (:nogroupheader:)?

Here's the core of how I did it -- only a little longer.
The SearchQuickReference page could be Main.SearchWiki, but I
made it look like the other QuickReference pages.
(it uses a custom display fmt, which is optional)

SDV($PageSearchFmt,array("<h1 class='wikiaction'>$[Search Results]</h1>",
                         'markup:(:searchresults fmt=custom list=normal:)',

function HandleSearch($pagename) {
  global $HandleSearchFmt,$PageStartFmt,$PageSearchFmt,$PageEndFmt,$FmtP;
  $FmtP['/\\$LastModified/e'] = '$GLOBALS[\'CurrentTime\']';
  SDV($HandleSearchFmt,array(&$PageStartFmt, &$PageSearchFmt, &$PageEndFmt));

The rest is "merely corroborative detail..." 
John Rankin

More information about the pmwiki-users mailing list