Difference between revisions of "Help:Categories"

From OutHistory
Jump to navigationJump to search
m (Protected "Help:Categories" [edit=sysop:move=sysop])
Line 1: Line 1:
 
A '''category''' is a software feature of MediaWiki. Categories provide automatic indexes that are useful as tables of contents.
 
A '''category''' is a software feature of MediaWiki. Categories provide automatic indexes that are useful as tables of contents.
 +
  
 
To add a page to a category for example, type:
 
To add a page to a category for example, type:
Line 5: Line 6:
 
   <nowiki>[[</nowiki>Category:Category name]]
 
   <nowiki>[[</nowiki>Category:Category name]]
  
To be specific, in order to add an article called "Albert Einstein" to the category "People", you would edit the article and add <tt><nowiki>[[</nowiki>Category:People]]</tt> into the page source somewhere. Exactly where doesn't matter, but the convention is to put it ''after'' the article text.
+
For example, to add an article to the category "Law", you would edit the article and add <tt><nowiki>[[</nowiki>Category:Law]]</tt> into the page source somewhere. While exactly where doesn't matter but the convention is to put the categories at the end, ''after'' the article text. We encourage you to use Categories that have already been established. To see already established Categories see the Contents Page. For a complete list of categories, see [[Special:Categories]].
 
 
A category page does not need to be created beforehand. Putting a category link in one of the articles will automatically create that category and display the page (or pages) that belongs to it. By looking at the very bottom of the any article, you can tell what categories it belongs to, if any. Categories, if they exist, are always displayed there. Although a category has multiple articles in it, it will appear as a red link when a description of the category page is empty. To make the category links appear blue (like existing articles), click on the category link to go to the category page and edit it to add a short description.
 
  
Categories can have sub-categories, meaning that you can put a category page inside of another category. Categories can be nested in multiple level in this fashion. For example "Social Sciences" category may contain a list of categories such as "Sociology", "History", etc... Only after clicking on one of them, you would get the list of articles in that particular sub-category.
+
A category page does not need to be created beforehand. Putting a category link in one of the articles will automatically create that category and display the page (or pages) that belongs to it. By looking at the very bottom of any article, you can tell what categories it belongs to, if any. Categories, if they exist, are always displayed there. Although a category has multiple articles in it, it will appear as a red link when a description of the category page is empty. To make the category links appear blue (like existing articles), click on the category link to go to the category page and edit it to add a short description.
  
For a complete list of categories, see [[Special:Categories]].
+
When creating new categories, follow the conventions. For example, to create a category for a person, use this form Category:Last Name, First Name (yyyy-yyyy). After creating the category,  add [[Category:People]] to the resulting page to have it appear in the complete People category Index.  For US cities follow the format [[Category:State name-City]], then add the [[Category:State name]] to the resulting page. For questions about how this functions, we suggest you look at how existing Categories have been set up.  
  
To link to a category page from the article text (without adding the page to the category) prefix the link name with a colon. For example, <tt><nowiki>[[</nowiki>:Category:Out_and_Elected|Out and Elected category]]</tt> renders as [[:Category:Out_and_Elected|Out and Elected category]].
+
Categories have sub-categories, meaning that you can put a category page inside of another category. Categories can be nested in multiple level in this fashion. For example "Social Sciences" category may contain a list of categories such as "Sociology", "History", etc. This is how the People category is set up, each category for an individual is sub categoried under People. It also allows so categories to be into several hierarchies for example the Category:Sodomy Law can go under both Category:Sodomy and Category:Law.  
  
==Sort key==
 
Categories are listed in alphabetical order by default. If you want an item in a list to be positioned in that order, but according to an alternative name (sort key), use the following syntax:
 
  
<nowiki>[[</nowiki>Category:category name|sort key]]
+
== Linking to a Category Page ==
  
For example, to have Albert Einstein article sorted as "Einstein, Albert". You would type the following:
+
To link to a category page (without adding the page to the category), include a colon before the complete Category page name.  For example, <tt><nowiki>[[</nowiki>:Category:People]]</tt> renders as [[:Category:People]].
  
  <nowiki>[[Category:People|Einstein, Albert]]</nowiki>
 
  
 
==Singular or plural==
 
==Singular or plural==

Revision as of 13:22, 21 May 2008

A category is a software feature of MediaWiki. Categories provide automatic indexes that are useful as tables of contents.


To add a page to a category for example, type:

 [[Category:Category name]]

For example, to add an article to the category "Law", you would edit the article and add [[Category:Law]] into the page source somewhere. While exactly where doesn't matter but the convention is to put the categories at the end, after the article text. We encourage you to use Categories that have already been established. To see already established Categories see the Contents Page. For a complete list of categories, see Special:Categories.

A category page does not need to be created beforehand. Putting a category link in one of the articles will automatically create that category and display the page (or pages) that belongs to it. By looking at the very bottom of any article, you can tell what categories it belongs to, if any. Categories, if they exist, are always displayed there. Although a category has multiple articles in it, it will appear as a red link when a description of the category page is empty. To make the category links appear blue (like existing articles), click on the category link to go to the category page and edit it to add a short description.

When creating new categories, follow the conventions. For example, to create a category for a person, use this form Category:Last Name, First Name (yyyy-yyyy). After creating the category, add to the resulting page to have it appear in the complete People category Index. For US cities follow the format, then add the to the resulting page. For questions about how this functions, we suggest you look at how existing Categories have been set up.

Categories have sub-categories, meaning that you can put a category page inside of another category. Categories can be nested in multiple level in this fashion. For example "Social Sciences" category may contain a list of categories such as "Sociology", "History", etc. This is how the People category is set up, each category for an individual is sub categoried under People. It also allows so categories to be into several hierarchies for example the Category:Sodomy Law can go under both Category:Sodomy and Category:Law.


Linking to a Category Page

To link to a category page (without adding the page to the category), include a colon before the complete Category page name. For example, [[:Category:People]] renders as Category:People.


Singular or plural

It is not obvious whether a page like Amsterdam should be in category City (a description of a member of the category) or Cities (a description of the category as a set of pages). A convention for using one or the other is useful and should be codified. (Here is Wikipedia's convention). Sticking to the convention will help to avoid having both categories, with part of the pages in one, and part in the other.

Moving a category page

The only way to move a category page is to manually change all category tags that link to the category, and copy the editable part. There is no automatic way to move a category page in the way one moves an article page.

More

Wikipedia's Category Help.