[Pmwiki-users] 0.6-beta -- possible change to search results
Patrick R. Michaud
Mon Jan 26 07:49:08 CST 2004
On Mon, Jan 26, 2004 at 04:21:37PM +1300, John Rankin wrote:
> One of the features of the previous version of [[$Search]] is that the
> search results display as if from that page name and hence group name.
> So adding a group-restricted search box to the search results page means
> the search is restricted to the original search group. However, with the new
> scheme, the first search will be restricted to the originating group, say
> PmWiki/, whereas subsequent searches would be restricted to the Main/ group.
Wouldn't have to be. [[$Search]] (or some other tag such as [[$Searchgroup]])
can now easily be defined to restrict the search to the group used in the
$SearchTagFmt = "<form action='\$ScriptUrl/$SearchPageFmt' method='get'>
<input type='hidden' name='group' value='\$SearchGroup' />
<input type='text' name='text' value='\$Needle' size='40' />
<input type='submit' value='$[Search]' /></form>";
The search.php code automatically sets $SearchGroup and $Needle based
on the contents of the text= and group= parameters to the page.
> Also, have you considered putting [[$Searchresults]] above the [[$Search]]
I considered it but haven't tried it yet--I was waiting to see what other
orderings/layouts pmwiki-users might suggest. :-)
> >I'm also thinking of adding [[$Searchresults text]], which uses "text"
> >as the default string for the search if no other text is specified,
> >and perhaps [[$Search text]], which pre-fills the search box with "text"
> >if no text is specified.
> So if I put:
> [[$Searchresults [[$Title]]]]
> in a GroupFooter I'd automatically get a list of referring pages at the
> foot of every page?
I hadn't thought of that particular application but yes it would work! :-)
> Cool. But why is it [[$Searchresults text]] and not (say) [[search text]]?
> It looks to me more like a directive (cf [[include:...]]) than a variable.
I was staying parallel with [[$Search]], but you're correct that a
[[search:]] syntax might be more consistent. Or are you suggesting there
should be both a [[$Searchresults]] and a [[search:text]]? I'll have to
think on this one... :-)
More information about the pmwiki-users