following text to anywhere in the page:
[[Category: category name ]]
Nothing will be displayed where that text was added. Instead, at the bottom of the page, text that looks like the following will be displayed, showing all the page’s categories, in the order they were defined on the page:
Categories : 1899 births | 1957 deaths | 20th-century actors | Actors from New York City | American chess players | American Episcopalians | American film actors ...
Category tags can go anywhere in a page, but to keep things readable, the usual convention is to place them at the bottom of the page, with one tag per line. So the wikitext that would generate the previous set of displayed categories might look like this:
[[Category:1899 births]]
[[Category:1957 deaths]]
...and so on.
There’s one other important place in which categories are declared: within templates. On Wikipedia, the “Proposed deletion...” categories are one example of categories set via templates. (When using Semantic MediaWiki, it is in fact recommended that all category declarations be made via templates; you can see a full explanation of that here .)
Every category has a page in MediaWiki associated with it, which is just the name of that category, preceded by the name of the category namespace, which in English is just "Category:". So the page for a category called “Cars” would be at “Category:Cars”.
Let’s go through the structure of a category, using a real-life example. Here is the top of the page “Category:Hydraulic engineering” category on the English-language Wikipedia:
The top part of the category page consists of whatever text has been manually placed there. Below that is the set of subcategories, if any, for this category; i.e., categories tagged as belonging to this category. Here is that list, again for the Hydraulic engineering category page:
The categories are displayed in alphabetical order, in three columns, with headers for each initial letter. There is also an arrow next to each subcategory name, which can be used to drill down through the hierarchical list of subcategories for each of these subcategories. This arrow functionality is not standard, and comes from the CategoryTree extension ( see here ).
Finally, there’s the heart of the category page: the listing of all the pages it contains. Here is just the top of that list, again for the same Wikipedia category:
Pages, like subcategories, are displayed in three columns, with headers for the first letter of the name.
If a category contained any images, below the listing of pages would be a display of the thumbnails of all the images, in gallery format (this is not shown here).
If you click on a category name, and the page for that category hasn’t been created yet, you’ll see a message saying that the category doesn’t exist yet; but it will still list all its pages and/or subcategories. Every category that’s used should ideally have a page created for it. You have to add some content to a page in order to be able to save it: a simple sentence explaining the category is usually what’s done, although even just a "Category" tag, to establish a parent category for this category, would do the trick.
By default, a category page lists its member pages in alphabetical order. This doesn’t always make sense, though: you might want to list people by their last name, you might want to list names that start with “The” under their second word, and so on. You can do that for a particular member page by just adding the indexing string after a pipe in the category tag. For example, to list the page “The Archies” under “Archies, The”, you would place the following in the page “The Archies”:
[[Category:Musical groups|Archies, The]]
Or, if the page belongs a lot of categories, and you want to index it the same way in all those categories, you can use the “DEFAULTSORT” behavior switch on the member page, like this:
{{DEFAULTSORT:Archies,