Difference between revisions of "Help:Categories"
m (link to the bug, since it exists) |
m (1 revision) |
(No difference)
|
Revision as of 21:37, 12 January 2010
MediaWiki allows you to categorize pages and files by appending one or more Category {{#ifeq:Category|Category||(Category)}} tags to the content text. Adding these tags creates links at the bottom of the page that take you to the list of all pages in that category, which makes it easy to browse related articles.
Contents
Add a page to a category
To add a page or uploaded file to a category, simply edit the page and add the following text (where NAME is the name of the category you want to add it to).
[[Category:NAME]]
Any number of Category tags may be added to the page and the page will be listed in all of them. Category tags can be added wherever you like in the editing text, but they are usually added at the very bottom for the convenience of other editors.
If categories are placed into a section of text by themselves, any nearby excess whitespace will be ignored. If placed between a list and regular text, you will need to manually add the <br /> linebreak.
Adding Category tags to categories will make them subcategories. It is a good idea to organize all your categories into a hierarchy with a single top level category.
Sort key
A sort key specifies where the page will appear in the category list, and under which letter heading. (By default, the page is sorted under the first letter of its full name including its namespace.) You can add a sort key to a page by adding it inside the Category tag. For example, the tag below will add the page under the heading "S".
[[Category:NAME|SORT]]
Sort keys are case-sensitive, and a space is also valid. The order of the sections within a category follows the Unicode sort order. The sort key does not change the page title displayed in the category.
Create a category
A category can be created the same way as as other wiki pages (See Help:Starting a new page); just add "Category:
" before the page title. (Category lists exist even if their description page is not created, but these categories are isolated from others and serve little purpose for organization or navigation.)
It is not possible to rename (move) a category, unlike other wiki pages. It is necessary to create a new category and change the Category tag on every page. The new category will not have the older category's page history, which is undesirable if there are many revisions.
To avoid extra work, try searching within your wiki before creating a new category. The list of all categories can be found in "special pages" in the "tools" box of the sidebar.
Hidden categories
The categories that a page is in are normally listed at the bottom of the page. A category can be hidden from these lists by adding "__HIDDENCAT__
" to the category page. (Each user can choose to see them in a separate "Hidden categories" list, by checking "Show hidden categories" in the "Misc" section of Special:Preferences.)
Hidden categories are automatically added to Category:Hidden categories (specified by MediaWiki:Hidden-category-category).
Hidden categories are not hidden on category pages ({{#switch:{{{2}}} |RESO= |}}bug 15550{{#if:| [{{{2}}}]}})
Linking to a category
To create a link to a category, use a leading colon before the category name. (Without this colon, it will add the current page to the category.) To change the link text, write the text inside the link tag after a pipe.
[[:Category:NAME]] [[:Category:NAME|TEXT]]
For example, to link to "Category:Help", write "[[:Category:Help]]
", which will result in Category:Help.
Redirect pages must also use the colon, otherwise it will be added to the category instead of redirecting.
Template
Syntax
{{Languages|PageName}}
- PageName (optional) - the name of the page to display language links for. If omitted then the English version of the current page is used. This parameter can normally be omitted, as it is only required if you want to link to a page other than the one you place the template on, which is very uncommon. If this parameter is used on a sub-page make sure you supply the root name, not the full page name (e.g. on MediaWiki/fr you would need to use
{{Languages|MediaWiki}}
and not{{Languages|MediaWiki/fr}}
).
Usage
The template should only be placed on pages that exist in more than one language, and it should be placed in the same location on each translation of the page.
The English version of a page is always the main version, with all other languages as sub-pages, named using the appropriate language code (see below).
For example, on the Main Page you would include the text {{Languages}}
, both on Main Page itself, and on each of its language sub-pages. The template automatically creates links to any language sub-pages that exist, e.g. Main Page/ja<tt>, <tt>Main Page/fr, and ignores non-existant languages.
See Project:Language policy for further details about translating pages.
Supported languages
This shows you the name of each language's sub-page (using Main Page as an example). Other languages may be added easily as necessary. Please use the appropriate prefix, as used on Wikipedia when adding a new language. Please do not add languages for which no pages exist yet, as this will increase the time needed to include the template without adding any benefit (languages are only displayed to the user when the relevant page exists).
The link on the language names goes to the Wikipedia in that language. If no Wikipedia in your language exists, do not add pages in that language to MediaWiki.org! This wiki is not the place for language advocacy - please go through the correct channels, and once your language has a Wikipedia then please return to add content here.
Page Name | Language |
---|---|
Main Page | English |
Main Page/af | Afrikaans |
Main Page/ar | Arabic |
Main Page/az | Azerbaijani |
Main Page/bcc | Southern Balochi |
Main Page/bg | Bulgarian |
Main Page/br | Breton |
Main Page/ca | Catalan |
Main Page/cs | Czech |
Main Page/da | Danish |
Main Page/de | German |
Main Page/el | Greek |
Main Page/es | Spanish |
Main Page/fa | Persian |
Main Page/fi | Finnish |
Main Page/fr | French |
Main Page/gl | Galician |
Main Page/gu | Gujarati |
Main Page/he | Hebrew |
Main Page/hu | Hungarian |
Main Page/id | Indonesian |
Main Page/it | Italian |
Main Page/ja | Japanese |
Main Page/ka | Georgian |
Main Page/ko | Korean |
Main Page/ksh | Kölsch |
Main Page/ml | Malayalam |
Main Page/mr | Marathi |
Main Page/ms | Malay |
Main Page/nl | Nederlands |
Main Page/no | Norwegian |
Main Page/oc | Occitan |
Main Page/pl | Polish |
Main Page/pt | Portugese |
Main Page/pt-br | Brazilian Portuguese |
Main Page/ro | Romanian |
Main Page/ru | Russian |
Main Page/si | Sinhalese |
Main Page/sk | Slovak |
Main Page/sq | Albanian |
Main Page/sr | Serbian |
Main Page/sv | Swedish |
Main Page/ta | Tamil |
Main Page/th | Thai |
Main Page/tr | Turkish |
Main Page/uk | Ukrainian |
Main Page/vi | Vietnamese |
Main Page/yue | Cantonese |
Main Page/zh | Chinese |
Main Page/zh-hans | Chinese (Simplified) |
Main Page/zh-hant | Chinese (Traditional) |
Main Page/zh-tw | Chinese (Taiwan) |
Example
Here is how the language bar looks on the MediaWiki page: Template loop detected: Template:Languages