[Pmwiki-users] Category implementation

Patrick R. Michaud pmichaud
Wed Oct 27 20:53:27 CDT 2004


On the pmwiki 2 site I've gone ahead and added the [[!XYZ]] markup to 
indicate that a page belongs to category XYZ.  I'm planning that this
will end up as part of the distribution (2.0.devel20) but would appreciate
any suggestions as to the default rendering of category links (if different
from normal links) and any other category-related features that should either
be enabled by default or available as part of the distribution.

For the curious, here's the code I'm currently using to enable
categories (in scripts/stdmarkup.php):

## [[!Category]]
SDV($CategoryGroup,'Category');
SDV($LinkCategoryFmt,"<a class='categorylink' href='\$LinkUrl'>\$LinkText</a>");
Markup('[[!','<[[','/\\[\\[!(.*?)\\]\\]/e',
  "Keep(MakeLink(\$pagename,PSS('$CategoryGroup/$1'),
    NULL,'',\$GLOBALS['LinkCategoryFmt']),'L')");

$CategoryGroup is the group to be used for category pages; $LinkCategoryFmt
says how category links should be formatted.

All are welcome to experiment with and build categories for pages on the
PmWiki 2 site.  In the near future I'll be looking to develop a sidebar
category navigation system (i.e., that displays where the current page 
appears within a category hierarchy).

Pm



More information about the pmwiki-users mailing list