|
PmWiki /
Categories< Passwords | Documentation Index | Page lists > authors (intermediate)
Categories? (also known as "tags") are a way to organize and find related pages. Categories are implemented by default in PmWiki. The idea is that every page that falls into a particular "subject" area should have a reference to a shared page containing links to other pages on that subject. These pages are created in the Category group, and thus these subject areas are called "categories". Using categoriesGetting categories to work requires a single step: adding a reference to a category on a page.
A category named The markup for creating these references is: A Category.GroupFooter file is included in the PmWiki release that contains the line Note: use the markup (:pagelist category={*Name} list=normal:) to include only 'tagged' pages.
It is worth noting that rather than using Because we use the normal PageList An administrator can override the default category group name of " A page author can link to a category list without adding the linking page to the category by using the full URL link markup RecapSo, by adding the markup Category nestingCategories have the potential for even greater usefulness because Film.ShaunOfTheDead [[!Horror]] [[!Comedy]] [[!2003]] Film.InMyFathersDen [[!Drama]] [[!2004]] Film.TheCorporation [[!Documentary]] [[!2003]] Now then, we can create So, what happens when we display Finally, in Category.Category Category.Genre Category.Comedy Film.ShaunOfTheDead Category.Drama Film.InMyFathersDen Category.Documentary Film.TheCorporation Category.Horror Film.ShaunOfTheDead Category.Year Category.2003 Film.ShaunOfTheDead Film.TheCorporation Category.2004 Film.InMyFathersDen 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.) It can also contain associations to related categories ("see also" references). For example, in a tourism wiki, the ''bed and breakfast" category might contain a see-also reference to the "self-catering" category. Coming up with good category schemesThe 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 thesauri (ISO 25964). Questions to think about include:
Or you can just let people use whatever category terms they find meaningful. A vocabulary (or "folksonomy") will emerge over time. Showing a list of categoriesTo show a list of categories we can use a pagelist for the pages in the category group. For instance the following will list pages in the Category group, put it on page Category.Category? for convenience, or on any other page: (:pagelist group=Category list=normal fmt=#title:)
But there is a problem: Just adding a category markup to a page will not create a corresponding category page, even though following the link will show the page with a list of pages linking to it! $AutoCreate['/^Category\./'] = array('ctime' => $Now, 'text' => 'List of pages linking to {$Title}'); (note the quotes)
Change 'Category' to the name of your category group. You can also add more definitions for more category groups, useful if you use a recipe like Cookbook:Tagger which allows multiple category groups. See also EditVariables#AutoCreate < Passwords | Documentation Index | Page lists > This page may have a more recent version on pmwiki.org: PmWiki:Categories, and a talk page: PmWiki:Categories-Talk. |