SonicWikiPersos
JeuxMegadrive
MegaCD32XSaturnDreamcast/GCGame Boy AdvanceMultiplateformesDessins animés |
This page is still under development.
Categories are already implemented in PmWiki 2, and in most wikis they don't require any special code or markup, they're just a useful convention in Wiki pages. The idea is that every page that is in a given category should have a link to a shared category page. There is also a special markup as a shortcut to category-entries: [[!category]] will create a link to Category/category Since PmWiki has WikiGroups, I'll assume that category links go to the Category group. However, bear in mind that you can use any group or page naming scheme for this -- it's just a convention and doesn't require special programming support. TODO: special wiki-var for categories The key aspects of building a category are:
note: all pages that contain the text "Category.XYZ" are displayed. A future version will allow (:pagelist linkto=Category.XYZ:) or (:pagelist backlink=Category.XYZ:) (I'm still working on the syntax), which will strictly search for links and not text. TODO: check implementation and change this docs
PmWiki 2 makes this second step incredibly simple, since you can get easily generate a list of all pages with links to So, that's really all there is to categories. But wait, there's more! As John Rankin pointed out in his excellent post, the above convention, combined with the fact that all of the category pages are in a single group, means that we can do much more. If we create a page called then every page in the Category group, even empty/non-existent ones, will display a list of pages that are in the category named by the page.
For example, the It finds any instances of "Category.XYZ" in the text, and it also finds any page that has an outgoing link to Category.XYZ (regardless of whether that link was specified as [[Category.XYZ]], [[Category/XYZ]], [[Category.X(Y)Z]] , or even [[x y z]] ).
Also, pages such as RecentChanges show up in the category by default and probably should be filtered with list=normal :
(:pagelist Category.{$Name} list=normal:)
(it's not possible to add the non-existent pages as a link in a page, cause this link will automatically turned into an action=edit-link so you can add the link only in the URL-field of the browser)
So, what do we get? Every page belonging to But that's not all...! The
Now then, we can create So, what happens when we display Finally, in Category.Category Category.Genre Category.Comedy Note however that this isn't a "strict" hierarchy--i.e., any page or category can appear simultaneously in multiple categories. For example, Each category page can have content text before the generated list, e.g., to give a generic description of things in the category. (Or it can be empty, which works fine.) And all of this works "out of the box" without any modifications to PmWiki 2.0! John goes a step further and proposes that we create a special markup for "Category", so that one can write things like When we choose a good markup, this is all that's needed: (uses [[!Comedy]] for illustration)
SDV($CategoryGroup,'Category'); Markup('[[!','<links','/\[\[!([^\|\]]+?)\]\]/', "<span class='category'>[[$CategoryGroup/$1]]</span>"); Hope this helps. The advantage of a separate category markup is that authors can assign pages to categories independently and explicitly. It lets authors distinguish between a category reference and a reference to a page that happens to be a category page. The hard part about using categories is choosing a good vocabulary. Site content managers may wish to follow the Guidelines for the establishment and development of monolingual thesauri (ISO 2788-1986) and the Guidelines for the establishment and development of multilingual thesauri (ISO 5964-1985). Questions to think about include:
(quotes of postings in pmwiki-user-maillist)
TODO: add the text of John Rankins post too ? samples (created in groups
|