Help:Category

From /ic/ sticky
Jump to navigationJump to search

This is a ShoutWiki help page, hosted at ShoutWiki Hub. If you want to suggest changes, leave a message on its talk page. If you want to replace this page with a custom help page for your wiki, click the create button above.

MediaWiki allows you to categorize pages by adding one or more category links to the text. Adding categories creates links at the bottom of the article which take you to the list of all pages in that category, which makes it easy to browse related articles.

How to add categories

To add an article to a category put the following at the end of the page you are editing:

[[Category:NAME]]

where NAME is the name of the category you want to add it to. A page may be added to any number of categories - the page will be listed in all of them.

You can also specify an additional SORT or collation parameter that dictates where the page appears, alphabetically, within the category. By default, the page is collated by its name. Changing that is achieved by using the following markup:

[[Category:NAME|SORT]]

So for example, to add this page to the 'Help' category, you would use:

[[Category:Help|Categories]]

'Categories' is the collation order. Other situations where you might want to use the sort parameter is when you have articles about people that are titled as FirstName LastName but within the category you want them listed as LastName, FirstName.

Another way to sort the article in the correct letter without the namespace is

[[Category:Help|{{SUBPAGENAME}}]]

This is extremely helpful when using templates which include a category tag.

The SORT order does not affect how the page title is displayed within the category listing, just how it is ordered. In the above example, the link to this page will still be 'Help:Category', and not 'Categories'.

Linking to category pages

To create a link to a category page:

[[:Category:NAME]]

If you were linking to the Category Page for Help on MediaWiki, the link would look like this: Category:Help

If you want to display alternate text for the link:

[[:Category:NAME|TEXT]]

Here is an example of the same link to the Category Page for Help on MediaWiki as above, but with alternate text: MediaWiki Help Index

Categorize categories

Categories themselves and other uploaded files like pictures can be categorized exactly like normal pages. It is useful to connect the article-categories with categories already in place to establish connections and hierarchies. To this end, after saving the article, follow the category links at the end of the page to see, if the category is already in place and if not, categorize them until you connect them with an existing category. This is called a Category Tree.

Moving category pages

Category pages cannot be moved like other pages.

The only way (in no particular order) is to create the new page, delete the old one, and change the links in each member of the category (manually or with a bot).

However, category pages can be moved together with the full revision history, with some effort, by using the Special:Export and Special:Import functions.

See also

  • Special:Categories; a list of categories on ShoutWiki Hub. The special page is on every wiki.