[pmwiki-users] List Pages Using Multiple Categories

Peter & Melodye Bowers pbowers at pobox.com
Thu Feb 7 15:29:35 CST 2008

>From: pmwiki-users-bounces at pmichaud.com
[mailto:pmwiki-users-bounces at pmichaud.com] On Behalf Of Max Pfleger
>Subject: [pmwiki-users] List Pages Using Multiple Categories
>I was wondering if it is possible yet to create lists of pages using 
>more than category criteria.

The proper way to handle categories is looking for the actual link as
(:pagelist:) and others do.  I have no idea whether those can support 2
category searches or not.

However, if you're willing to go with a regex search instead you could use
WikiSh as follows:

{(grep -l '\[(?:Category\.CatA|!CatA)\]\]' (grep -l
'\[(?:Category\.CatB|!CatB)\]' Group1.* Group2.* Group3.*))}

(Assuming a category link will either look like [Category.CatA] or [!CatA] -
if I'm forgetting the actual syntax of categories, apologies - I assume
you'll get the idea.)

(The inner grep searches for CatB in any of the files and returns a file
list which is then searched through by the outer grep looking for CatA --
the result is a condition of "CatA AND CatB".)

That results in a fairly non-pretty listing of files.  You could use these
option in the outer grep to make them into links showing titles, or other
such applications:

 --line_prefix:"[" --line_suffix:"|+]"

It may not be what you're looking for, but at least it may be a step in the
right direction.

Noskule, did you have any success in combining MXes with pagelist?


More information about the pmwiki-users mailing list