[pmwiki-users] More than one Category Group

Bellave Jayaram bellavejayaram at cox.net
Fri Feb 24 12:23:41 CST 2006


Patrick,
	Thanks much. I got the impression that there is something special
about the Category group because of the $CategoryGroup variable.

	I continue to be amazed at how adaptable Pmwiki is and yet how
simple its design and syntax are compared to many others I have seen. Thank
you for continually improving it.

Jayaram

-----Original Message-----
From: Patrick R. Michaud [mailto:pmichaud at pobox.com] 
Sent: Friday, February 24, 2006 11:09 AM
To: Bellave Jayaram
Cc: pmwiki-users at pmichaud.com
Subject: Re: [pmwiki-users] More than one Category Group

On Fri, Feb 24, 2006 at 10:14:10AM -0700, Bellave Jayaram wrote:
>    Now, my question is if it would be possible to create another Category
>    Group called Films where there would be pages like Films.DirectedBy
(which
>    would contain a category Films.StevenSpielberg, Films.PeterJackson
etc.)
>    and Films.OscarWinning  (which would contain Film.LordOfTheRings,
>    Film.SavingPrivateRyan etc.).
>
>    In other words, can tags in different namespaces be accommodated in
>    Pmwiki? If so, how?

There's really nothing very special about the Category group 
itself, other than that we've created a [[!...]] markup that makes it
easy to create category links.

Any PmWiki page can serve as a "category".  For example, you
could create Films.StevenSpielberg and Films.PeterJackson, and
on each of those pages create a link to Films.DirectedBy, as in:

    Categories:  [[Films.DirectedBy]]

Then, on the Films.DirectedBy page (or anywhere else), you just do

    (:pagelist link=Films.DirectedBy list=normal:)

and you'll get a list of all of the pages that are in the
Films.DirectedBy category (i.e., have a link to the Films.DirectedBy
page), which would include the Films.StevenSpielberg and 
Films.PeterJackson pages.

Same steps apply for Films.OscarWinning -- just put links
to "Films.OscarWinning" in the relevant pages, and then use
pagelist to get a list of them.

>    A follow up question to this would be, if we can have multiple Category
>    Groups, would it be possible to confine search to a single Category
Group?

Sure, in the same way that searches can be confined to any PmWiki
group.

    (:pagelist group=Category:)         search only the Category group
    (:pagelist group=Films:)            search only the Films group
    (:pagelist link=Films.DirectedBy:)  search only the pages in the
                                          Films.DirectedBy category

The above also works with (:searchresults ...:) instead of (:pagelist ...:).
Or, if you're looking for a searchbox that limits searches to the group:

    (:searchbox group=Category:)        search pages only in Category
    (:searchbox group=Films:)           search only in Films

Pm





More information about the pmwiki-users mailing list