[pmwiki-users] Search box on PmWiki.org

Patrick R. Michaud pmichaud at pobox.com
Wed Jan 24 10:24:18 CST 2007


On Wed, Jan 24, 2007 at 08:13:22AM -0600, Patrick R. Michaud wrote:
> On Tue, Jan 23, 2007 at 10:01:45PM -0500, DaveG wrote:
> > For groups, how about:
> >    (:pagelist presort=group1,group2 :)
> 
> Well, I was somewhat hoping to not limit this capability to
> just groups and pagenames -- what if I wanted to set the output
> sequence based on a page variable or page text variable?
> 
> For example, in PITS I might want to display PITS pages
> sorted by the $:Category value such that all "Bug" pages
> appear first, followed by "Feature", followed by "Documentation",
> followed by everything else.
> 
> The current pagelist code makes it relatively easy to provide
> this sort of capability in a local customization file (using
> a custom order= parameter), but I was hoping to find a general
> way to do it from markup.

Hmmm, perhaps we could put the desired ordering in parens 
or brackets after the item to be ordered?

    (:pagelist order=$Group(PmWiki,Cookbook,PITS,*) :)
    (:pagelist order=$:Category(Bug,Feature,Documentation,*) :)

But then if someone wants to select only Bug/Feature/Documentation
(and display in that order), we get the unwieldy

    (:pagelist order=$:Category(Bug,Feature,Documentation) 
      $:Category=Bug,Feature,Documentation :)

So, perhaps it's more appropriate as some sort of marker that
means "order by" in the selection attribute itself, as in:

    (:pagelist $:Category=(Bug,Feature,Documentation) :)

which means to select only those pages where $:Category is
"Bug", "Feature", or "Documentation", and to display them in
that sequence.  To sort by name within those groupings,
one would use:

    (:pagelist order=$:Category,name $:Category=(Bug,Feature,Documentation) :)

Pm




More information about the pmwiki-users mailing list