[pmwiki-users] search a group only

Patrick R. Michaud pmichaud at pobox.com
Sun Mar 27 20:03:38 CST 2005


On Sun, Mar 27, 2005 at 05:45:40PM -0800, John W Morris wrote:
>    I am running PmWiki 2.0 Beta 26
>    [...]
>    Can't find a search.php file either.  Search work fine... just can't find
>    either file. I want to limit searches when you are in a category to that
>    category..

Do you want to do this for the search box that appears in your
skin template (i.e., in the page's headers and footers), or are
you using the (:searchbox:) markup to create group-specific search
pages?

If you want to change the behavior of the box in the skin template,
you need to edit the template file and add a line

   <input type='hidden' name='group' value='$Group' />

into the search form.  For example, in the searchbox that comes with
PmWiki's default skin (in pub/skins/pmwiki/pmwiki.tmpl), you would
change

  <div id='wikihead'>
  <form action='$ScriptUrl/$[Main/SearchWiki]'>
    <input type='hidden' name='n' value='$[Main/SearchWiki]' />
    <a href='$ScriptUrl/$[Main/SearchWiki]'>$[SearchWiki]</a>:
    <input class='searchbox' type='text' name='q' value='' />
    <input class='searchbutton' type='submit' value='$[Go]' /></form></div>

to

  <div id='wikihead'>
  <form action='$ScriptUrl/$[Main/SearchWiki]'>
    <input type='hidden' name='group' value='$Group' />
    <input type='hidden' name='n' value='$[Main/SearchWiki]' />
    <a href='$ScriptUrl/$[Main/SearchWiki]'>$[SearchWiki]</a>:
    <input class='searchbox' type='text' name='q' value='' />
    <input class='searchbutton' type='submit' value='$[Go]' /></form></div>

Other skins may do this differently.

If you want to adjust the (:searchbox:) markup, you can simply change
it to read

   (:searchbox group={$Group}:)

and searches will default to the current group.

Hope this helps -- feel free to write back with more questions.

Pm



More information about the pmwiki-users mailing list