[Pmwiki-users] Categories instead of hierarchies? (was: can pmwiki handle hierarchical content?)

Patrick R. Michaud pmichaud
Wed Oct 20 14:50:35 CDT 2004


On Wed, Oct 20, 2004 at 10:34:26PM +0200, Knut Alboldt wrote:
> 
> 1) to make the categories-scan faster, it could be worth to set up an index 
> (sql-db based / php-array etc) of all pages / categories after editing a 
> page (also useful for things like (big) PITS - I'm just working on that). 
> This index could be used for faster processing the directive.

Making it cross reference all pages/categories may be a bit time consuming  
and tricky.  However, as of pmwiki-2.0.devel13, whenever someone saves a 
page the list of direct targets is already saved in the targets= attribute 
for the page, which will speed up the search considerably because one
doesn't have to search the page text.  (I added this to be able to get
faster backlinks and searches.)

The standard wiki "category" concept, where groups are unavailable,
is that a person adds "CategoryXXX" to every page that belongs in category
"XXX".  One can then do a backlinks search to find all of the pages
in CategoryXXX, and a page can easily belong to multiple categories.

In PmWiki, one might do it differently:
  - Instead of doing "CategoryXXX" to place a page in a category, it might 
    make more sense to use "Category/XXX" -- i.e., have all of the 
    category pages in a single "Category" group.  One could then get a 
    list of all of the categories by simply listing all of the pages 
    in the Category group   (:pagelist group=Category:)
  - Or, one could create a (:category:) directive to define a page's 
    membership in a category.
  - And, if someone wants to add a page to a category but doesn't want the
    link to appear in the page text, then  %comment% Category.XXX %% works 
    just fine.

In fact, in PmWiki 2.0, one can get a list of all of the pages in a category by
simply doing a search for "Category.XXX", or even doing

    (:pagelist Category.XXX:)

Yes, this really does work in 2.0.devel13 (or, at least it should--I
haven't tried it yet but it was part of the design).

What will really be fun is when we create a "fmt=publish" parameter
to pagelist, which will allow

    (:pagelist Category.XXX fmt=publish:)

and

    (:pagelist trail=PmWiki.DocumentationIndex fmt=publish:)

to have all of the pages in a category/trail to be concatenated into
a single page suitable for printing.

Pm



More information about the pmwiki-users mailing list