[pmwiki-users] Redirect search results to SearchResults page.

Patrick R. Michaud pmichaud at pobox.com
Mon Oct 24 11:36:39 CDT 2005


On Mon, Oct 24, 2005 at 11:34:59AM -0400, Waylan Limberg wrote:
> On 10/21/05, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > On Fri, Oct 21, 2005 at 03:44:34PM -0400, Waylan Limberg wrote:
> > > As an aside. I also want to not search that one group when in any
> > > other group, but I can't seem to override the restriction in
> > > config.php from groupname.php
> >
> > A groupname.php file is only loaded when viewing a page in that
> > group; it's not loaded when accessing a page from another group.
> > However, it can be done using a custom list= option to (:pagelist:),
> > set list=default to exclude the group, then use a different list=
> > parameter when searching from the group.
>
> Yes, I know, but this doesn't address my problem (Ok maybe is does,
> but I'd rather do this in the config file). In the default config.php
> I am restricting search from including one group and I don't want to
> do this in groupname.php files for each group. Then in the
> RestrictedGroup.php I want to override that and only search in that
> group. However, seeing I'm using $SearchPatterns['default'[] = ...
> there isn't any easy way to override that.

How about something like this...?

In your local/config.php, set

    $SearchPatterns['default']['resgroup'] = '!^RestrictedGroup\.!';

This sets the default search to not include any pages in RestrictedGroup.

Then in local/RestrictedGroup.php, set

    $SearchPatterns['default']['resgroup'] = '/^RestrictedGroup\./';

This changes the setting made in local/config.php so that the
search default searches for pages *only* in the RestrictedGroup.

This won't work when we redirect searches to a central Site.Search
page (because local/RestrictedGroup.php isn't loaded then), but
we can probably deal with that issue then.

Pm





More information about the pmwiki-users mailing list