[pmwiki-users] Arbitrary filtering for (:pagelist:) - is there a better way?

Patrick R. Michaud pmichaud at pobox.com
Tue Jul 18 16:34:49 CDT 2006


On Tue, Jul 18, 2006 at 01:43:35PM -0000, Michael Tempest wrote:
> ...
> This all works. My question is - is there a better way?
> 
> 1) Is there a way to do with without modifying pagelist.php?

At present, no.  I've been wanting to update pagelist so that
it's easy to add custom filters -- I just haven't gotten around
to it yet (because it implies that the existing selection features
should probably also be implemented as filters).

> 2) I'm not very familiar with php's array functions (in fact, PmWiki is my 
> first encounter with php), so is there a better way to reduce the list than 
> "$list = $SearchFilterFunctions[$opt['filter']]($list);" ?

Probably okay.  One question is of course what to do if multiple
filters are specified (which is what I'm intending to do).  Also,
some filters will want to have a parameter, so that instead of
something like

    (:pagelist filter=future:)
    (:pagelist filter=custom:)

I'd prefer to have things like

    (:pagelist when=future:)
    (:pagelist custom=xyz:)

> 3) I've not been working with (:pagelist:) for very long. As a 
> generalisation, is it better to be inclusive or exclusive with 
> pagelists and the like? 

As a generalization, we need to be able to support both inclusion
and exclusion from lists.  The wildcards support this, and we've
already come up with cases where we want to be able to say
both "on trail XYZ" and "not on trail XYZ", or "linked to XYZ"
and "not linked to XYZ".

Pm




More information about the pmwiki-users mailing list