[pmwiki-users] categories in pagelist

Petko Yotov 5ko at free.fr
Mon Apr 2 14:38:54 CDT 2007


On Monday 02 April 2007 21:16, Patrick R. Michaud wrote:
> On Mon, Apr 02, 2007 at 08:55:35PM +0200, Petko Yotov wrote:
> > On Monday 02 April 2007 19:29, Patrick R. Michaud wrote:
> > > On Mon, Apr 02, 2007 at 04:35:38PM +0000, J. Meijer wrote:
> > > >    On 4/1/07, Petko Yotov <5ko at free.fr> wrote:
> > > >      Currently we can not search for more than one page in the
> > > > "link=" parameter,
> > > >      so in the third example "link=Cat1,Cat2" is just ignored. It
> > > > would be really
> > > >      nice though, Patrick, if that became possible (also with
> > > >      negatives "link=Cat1,-Cat2").
> > >
> > > Just checking...  do you want "link=Cat1,Cat2" to mean "all pages with
> > > links to either Cat1 or Cat2" or "all pages with links to both Cat1 and
> > > Cat2"?
> >
> > Thanks Patrick. I always thought that this should behave like the word
> > match filter, so, "link=Cat1,Cat2" to mean "all pages with links to both
> > Cat1 and Cat2".
>
> I think this is inconsistent with the other filters -- consider
>
>     1.  group=PmWiki,Site
>     2.  name=Test*,XYZ*
>     3.  $:Status=open,closed,pending
>
> We expect these to mean
>
>     1.  pages in either the PmWiki or Site groups
>     2.  pages that begin with either "Test" or "XYZ"
>     3.  pages with $:Status of open, closed, or pending

Yes, but for a page we usually have one group, one name and at most one 
$:Status while we sometimes have more than one link. :-)


>
> Thus, to be consistent with the above, I would think that "link=Cat1,Cat2"
> should mean "pages with links to either Cat1 or Cat2".
>
> > I thought at one point that it may be possible to use "+Cat1" for
> > required and "Cat1" for optional, but it brings more trouble than
> > solutions.
>
> Actually, this is the approach I'm currently working on, so that
>
>     link=+Cat1,+Cat2           # pages with links to both Cat1 and Cat2
>     link=Cat1,Cat2             # pages with links to Cat1 or Cat2
>     link=Cat1,Cat2,+Cat3       # pages with links to Cat3 and (Cat1 or
> Cat2)
>
> But it's not completely trivial to implement.

I see inconsistencies with the "optional" Cat1 that is sometimes "required":

  link=Cat1              # same as link=+Cat1
  link=+Cat1,Cat2        # same as link=+Cat1 or link=+Cat1,+Cat2?
  link=-Cat1,Cat2        # same as link=-Cat1 or link=-Cat1,+Cat2?
  link=-Cat1,Cat2,+Cat3  # same as link=-Cat1,+Cat2 or link=-Cat1,+Cat2,+Cat3?

One more logical (for me) approach would be to use conditionals as in:
  link="(Cat1 && !Cat2) || Cat3"

but I fear this may be even more difficult to implement, and is definitely 
more inconsistent with the "group=" and other filters.

>
> >   For me what is absolutely essential is the speed of a pagelist,
> >   so I prefer to only use .pageindex and not open every file for
> >   inspection unless impossible (so: no PageTextVar search for now).
> >
> > > >    I believe this can be turned into a recipy after recent
> > > > pagelist.php refactorings.
> >
> > Yes, or if it were possible to define custom parameters like:
> >   myfunction=something
> > like it is currently possible to have a "list=" and "order=" custom
> > parameters.
>
> The new pagelist code in 2.2.0 does allow custom parameters, sources,
> and filters.

Wow, this is great. I'll take a look soon.

Thanks!
Petko






More information about the pmwiki-users mailing list