Philosophy
 

Help:Category

From WikiPagan

(Redirected from Help:Categories)

Help Pages
Editing | Linking | Categories

Policy Pages
Neutrality | Editing policy | Creating new articles | Naming conventions | Categories

Tips and tricks
Be bold

For a complete list of categories, see Special:Categories. For WikiPagan policy on the use of categories, see WikiPagan:Category.

Contents

[edit] What categories provide

Categories provide automatic indexes, each useful as a table of contents. Together with Links and Templates they structure a project.

[edit] Conventions

Each page is typically in at least one category. It may be in more, but it may be wise not to put a page in a specific category and also in a more general category.

Each category, except one top-level category, is typically in at least one higher level category.

For category names the usual rules for case-sensitivity of page names apply: they are case-sensitive beyond the first character, but the first character is case-insensitive. So be aware that you create a new category if the capitalization beyond the first character is not the same.

[edit] How categories are implemented

Each of the pages in the Category namespace represents a so-called category, a kind of grouping of related pages. For example, this page belongs to "Category:Help". When a page belongs to one or more categories, this information appears at the bottom of the page (or in the upper-right corner, depending on the skin being used).

The page of the category contains text that can be edited, like any other page, but when displaying the page, the last part of what is displayed is an automatically generated, alphabetical list of all pages in that category, in the form of links.

For a complete list of categories, see Special:Categories. Navigation is by number in alphabetic order, not by starting letter. For projects with thousands of categories this is cumbersome.

New categories can be created and edited in the same way as any other regular page¹, but when displayed, an automatically generated, alphabetical list of all pages in that category appears at the bottom.

You can assign a category to an article simply by adding "[[Category:categoryname]]" to the article's wikitext source. Substitute the actual name of the category in place of categoryname.

To be specific, in order to add an article called "Albert Einstein" to the category "People", you would edit the article and add "[[Category:People]]" (no quotes) into its page source somewhere. Exactly where doesn't matter.

[edit] Subcategories

Categories themselves can also be specified to belong to another category. When displaying the page of a category to which other categories belong, a separate automatically generated, alphabetical list of subcategories is also produced.

For example you could edit [[Category:Soccer]] and add the link [[Category:Sports]]. The Soccer category would then be a subcategory of the Sports category.

[edit] Categories to which a page belongs

Pages, including categories, can belong to more than one (other) category. The categories to which a page belongs are displayed in a fixed place, depending on the skin (the bottom for Monobook, the upper right corner for Standard), regardless of where in the wikitext they are specified.

[edit] Existing categories

You can see currently used categories for each project with Special:Categories. It produces a list of all categories, including those which contain subcategories or pages, but have no additional text. In that case a link to the category page shows up as link to a non-existing page that leads to the edit page. Avoiding this complication is an additional reason for entering in a category page at least a link to the main article on the field and a reference to a higher category to which it belongs.

[edit] Setting sort keys

If you want the article, in the list of articles in the category, to be positioned alphabetically by something other than its name you should use the following link form: [[Category:foobar|sort key]] (where foobar is the category name and sort key is the value to sort by).

For example to add an article called Albert Einstein to the category "people" and have the article sorted by "Einstein, Albert" ("Einstein" is the 1'st sort key and "Albert" the 2'nd) you would type "[[Category:People|Einstein, Albert]]".

The sort keys are case sensitive, so [[Category:The Foobar|Foobar]] is sorted before [[Category:The Bar|bar]].

[edit] A category tag in a template; caching problem

If a template contains the code indicating that it is in a category, this does not only put that template in the category, but also the pages that include the template.

The page that contains the template correctly lists the categories to which it belongs. However, adding or deleting a category tag in the template does not add or delete the listings on the category page of pages that use the template, until some edit is made in the page that uses the template.

In other words:

  • lists of categories a page is in, are up-to-date
  • lists of pages in a category are based on the situation just after the last edit of the pages

Since adding or removing a category or template tag is obviously an edit there is only a complication when a page is indirectly added to or deleted from a category, through a change in a template the page uses.

[edit] Linking to a category

If you want to link to a category without the current article being added to it you should use the following link form [[:Category:foobar]] (where foobar is the category name), note the extra : before Category.

[edit] Relation with "What links here"

A category is somewhat like a "What links here" page with regard to the special category links.

However, "What links here" tends to be a by-product of links that are useful anyway (although links may be put with this use in mind), while category links are put specially to produce a category page.

Linking from a test page, user page, etc. to a category is considered to pollute the category, while regular links from such pages showing up in "what links here" is considered harmless.

Category listings are alphabetical, for "What links here" this typically applies for the first part only, for the pages already linking to the given page at the time of the last rebuilding of the link tables in the database.

[edit] Applying "What links here" and "Related Changes" to a category

For the "What links here" and "Related Changes" features, only the links in the editable part of the page count, not the links to the pages in the category.

Contents

A category is a software feature of MediaWiki that provides automatic indexes, that are useful as table of contents. Together with links and templates they can structure a project and aid navigation.

Using categories

How can I categorize pages?

Any page can be put in a category by editing the page and adding a link to the category. Just type [[Category:]], and put the name of the category between the colon and the brackets.

[[Category:NAME]]

You can create new categories just by typing a new name. Pages can belong to more than one category, by having multiple category tags on the page.

All categories will appear at the bottom of an article page, in a "Categories" box. Clicking the category name will take you to a Category description page which will list all articles and subcategories contained within that category. You may click "edit" on a category description page to add additional text or images to the top of the page above the subcategory lists, and to place the category in another category.

Please note, category description pages are not designed to carry general content - they do not get counted in article statistics, and will not be found via many Special pages.

How do I create subcategories?

A category becomes a subcategory when you edit the category description page to add a Category tag for a "higher level" category. There is no limit to the number of subcategories a category may contain, or to the number of levels of categories. It is possible (though rarely desirable) to create category "loops".

The root category on most wikis is called Category:Browse. It is good practice to build a complete Category Tree, ensuring that all categories on your wiki have a place as subcategories of Category:Browse or its descendants.

How do I link to a category page?

To create an internal link to a category page without placing the edited page into the category itself, you must put a colon before the word "Category":

[[:Category:NAME]]

Can I redirect a category to another category?

No - attempting to Redirect a category will not work correctly (though it is technically possible). What you can do is add a notice (such as Wikia:Template:Category redirect) to inform users that a different category name should be used. You may then delete the old category once everything has been edited to show the correct category. However, if anyone might unknowingly try to re-create the "wrong" category, the template should remain in place for ever.[1]

Where can I see the currently used categories?

You can see a list of all currently used categories for each Wikia at Special:Categories. This list also displays how many pages are within each category.

You can reach this page by clicking the word "Categories" at the beginning of the box at the bottom of any categorized article, or by clicking "Special pages" in the sidebar.

Extensions

Category Tree

Special:CategoryTree is an alternate way to display the contents of a category. It can be transcluded in other pages. See mw:Extension:CategoryTree for details.

The extension also adds the ability to expand subcategories on a category page, allowing you to see further subcategories.

CategorySelect

CategorySelect (also sometimes referred to as 'Category tagging'), is a Wikia developed extension that allows users to quickly add a category to a page, without going into the edit mode for the page. It adds a small (usually green) button in the category area of the page, that uses AJAX functions to add the category code to the page for you.

Read more at Help:CategorySelect

See also

Notes

  1. See Wikipedia:Template talk:Category redirect for discussion.