Help:Categorization

From Shifti
Revision as of 15:44, 21 July 2007 by Virmir (talk | contribs) (Subcategories: Typo fix)
Jump to navigation Jump to search

Shifti allows pages to be automatically listed in groups called "categories". Category listings are very bare-bones, but their automated nature makes them very useful as a means of keeping track of comprehensive groups.

To add a page to a category, simply include a link to the category name somewhere on the page. For example, to put a page into the "Story" category, one would include the text "[[Category:Story]]" somewhere in the page. By custom this link is placed at the bottom, though since it doesn't show up in the resulting page text its exact location is not important.

If one wants to create a link to the category listing, put a colon at the front of the link. For example, to link to the "story" category listing one would use the following text: "[[:Category:Story]]". It produces the following link: Category:Story. To beautify the link you can use a pipe to give it different text. For example, "[[:Category:Story|all stories]]" produces the link "all stories"

Sorting within categories

By default, pages in a category listing are sorted alphabetically. This may not be ideal, however. For example, the page "The Once And Future King" would be sorted under "T", and "User:Joe Bloggs/Magic Cheese" would sort under "U".

To change the default sorting on a category-by-category basis, one can use the pipe to give a custom sort key to an article. For example, instead of putting "The Once And Future King" into Category:Story with "[[Category:Story]]", one could use "[[Category:Story|Once And Future King, The]]". The page's name would still be listed in the category as "The Once And Future King", but it would be sorted under "O" rather than "T". Similarly, one could use [[Category:Story|Magic Cheese]] to sort Joe's story under "M" instead of "U".

If a story belongs to many categories, or if some of the categories were added by templates and you can't easily change the sort keys for them, one can also use the DEFAULTSORT magic word to change the default sort key for a page. All one needs to do to do this is to insert the text "{{DEFAULTSORT:Once And Future King, The}}" somewhere in the text (by custom down at the bottom with the categories) and all categories on the page that don't have their own custom sort key will sort the page under "O". Note that the DEFAULTSORT magic word is surrounded by curly brackets rather than square brackets, and uses a colon rather than a pipe character before the sort key.

Also note that unlike article titles, the first character of a category sort key can be lower case. So if one inserts [[Category:Story|magic cheese]] into a page the page will be sorted under "m" rather than "M", which could make it hard to find. Due to the way ASCII characters are encoded lower case letters are alphabetized after the upper-case letters (ie, an alphabetized list goes A-Z, then a-z).

Subcategories

In addition to putting pages into categories, one can also put categories themselves into other categories. This results in a grouping of subcategories that can be useful for organizing large numbers of related pages. For example Joe Bloggs could put his stories into Category:Joe Bloggs, which is itself placed in Category:Author, and so someone browsing Category:Author would see just the Joe Bloggs subcategory listed there instead of having Joe Bloggs' stories mixed together with all the other authors' stories.