[pmwiki-users] How to specify target page for search results?
Patrick R. Michaud
pmichaud at pobox.com
Thu Jan 11 12:05:33 CST 2007
On Thu, Jan 11, 2007 at 10:14:11AM +0100, Roman wrote:
> On 1/11/07, Simon <s-i-m-o-n at paradise.net.nz> wrote:
> >
> > $SearchBoxOpt['target'] = 'Site.Search';
> >
> > You may also want
> > $PageSearchForm = '$DefaultGroup.Search';
> >
>
> Search results are still displayed in current page. Tested with clean
> pmwiki 2.2.0b19.
Sorry, I misinterpreted the original request. IIUC, you're
wanting every search, regardless of source, to always end
up at the same url (i.e., for the Site.Search page).
Try the following in local/config.php (probably near the bottom):
if ($action == 'search') {
$pagename = ResolvePageName($pagename);
if ($pagename != 'Site.Search') {
$qs = preg_replace('/\\bn=[^&?]*/', '', @$_SERVER['QUERY_STRING']);
Redirect('Site.Search', "\$PageUrl?$qs");
}
}
This will redirect any searches to the Site.Search page, which will
then display the results.
Pm
More information about the pmwiki-users
mailing list