Category Tags in MediaWiki
From LaurasWiki
Based on Meta-Wiki Help:Category (http://meta.wikimedia.org/wiki/Categories)
| Table of contents |
Add a category by tagging a page
To add a category in a MediaWiki wiki, just tag a page with the category. Use this code:
[[Category:''Category name'']]
Generally, it goes on a line by itself at the bottom of the page. Where the tag will appear in the rendered page depends on which skin is being used to view the wiki.
That tag will automagically create the category called, "Category name." Notice that while the code says, "Category," it renders as "Categories" when you view the page (see the category tag on this page, below bottom left).
The category tag will also cause the page on which it appears to be listed on the "Category name" page whenever that page is accessed.
Access the category index page
The first time you access the "Category name" page (say, click on the link "Category name"), the page will open in edit mode. It wants a description of the category.
Enter a brief description of the category and save the page. You should now see the description followed by an alphabetical list of the pages on which that category tag appears.
Link to a category without tagging
To add a link to the "Category name" page without tagging the page -- i.e. without adding that page to the category -- put a colon inside the double square brackets just before the word, "Category":
[[:Category:''Category name'']]
This renders as Category:Category name and is useful when you want to give a link to a category on a ToC page (Table of Contents), for example.
If you want to link to the Category name page without tagging the page and without the term "Category" appearing first, use the rules for in-wiki linking: add a pipe ("|") and repeat the Category name inside the brackets:
[[:Category:''Category name''|''Category name'']]
This renders as Category name. It's useful when you mention the category in a paragraph and don't want to disrupt the flow of the text -- but want to provide a link.
Case sensitivity
Categories, like page names in MediaWiki, are case sensitive. Use a redirect to send case variants to the same page.
Tag a page with multiple categories
To tag a page with multiple category tags, just use the entire tag again:
[[Category:''Category this'']] [[Category:''Category that'']]
On the rendered page, you will see something different: you'll see the term "Categories" followed by a list of the category names separated by pipes ("|").
Access an index of all the categories in the wiki
To access a list of all the categories in use in the wiki, click on the term "Categories" in the tag.
Or, to create a link to that overarching "Categories" page, use this code:
[[Special:Categories]]
You can also get there anytime by clicking on "Special pages" in the toolbox (middle left nav box), and choosing "Categories" from the list.
I have no idea why Categories is so far down in the list, or how to get the list to appear in alpha order. Probably, I need to go into the file system (oh no!).
The special Help category (and others)
Some categories seem to be built in, such as [[Help:Whatever]]. But actually, those aren't categories, exactly. They denote special sections of the wiki, with subpages -- specifically, separate namespaces. See Help:Contents.
I don't know how they work yet, exactly. See Meta-Wiki Help:Namespace (http://meta.wikimedia.org/wiki/Help:Namespace)

