Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Incubator escapee wiki:Categorization
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Categorization using templates <span class="anchor" id="TEMPLATECAT"></span><span class="anchor" id="TCAT"></span> == {{shortcut|WP:TEMPLATECAT|WP:TCAT}} Many [[Wikipedia:Template messages|templates]] include category declarations in their transcludable text, for the purpose of [[:Category:Tracking categories|placing the pages containing those templates into specific categories]]. This technique is very commonly used for populating certain kinds of administration categories, including stub categories and maintenance categories. See [[Template:Infobox roller coaster]] for an example that only adds a category by manufacturer if it exists, and otherwise uses a hidden category. However, it is recommended that articles not be placed in ordinary ''content'' categories using templates in this way. There are many reasons for this: editors cannot see the category in the wikitext; removing or restructuring the category is made more difficult (partly because automated processes will not work); inappropriate articles and non-article pages may get added to the category; [[#Sort keys|sort keys]] may be unavailable to be customised per category; and ordering of categories on the page is less controllable. When templates are used to populate administration categories, ensure that the code cannot generate nonsensical or non-existent categories, particularly when the category name depends on a parameter. Also, see [[Wikipedia:Category suppression|Category suppression]] for ways of keeping inappropriate pages out of template-generated categories. Category declarations in templates often use <code><nowiki>{{PAGENAME}}</nowiki></code> as the sort key, because this overrides any DEFAULTSORT defined on the page. {{anchor|Redirected categories|CATRED|Redirects}} ===Redirecting categories === {{redirect|WP:CAT-R|the guideline on categorizing page redirects|Wikipedia:Categorizing redirects}}{{shortcut|WP:CATRED}} {{for|an essay on this topic|Wikipedia:Category redirects that should be kept}} {{see also|Category:Wikipedia soft redirected categories}} <section begin=CATREDIRECT />Do {{em|not}} create inter-[[Help:Category|category]] redirects by adding <code><nowiki>#REDIRECT [[target]]</nowiki></code> to a category page. Unlike when [[Help:How to move a page|renaming articles]], categories cannot be [[Help:Redirect|redirected]] using "hard" redirects. Articles added to a "redirected" category will not show up in the target category. And since redirected categories do not become "[[Wikipedia:Red link|red links]]", editors won't be aware even when they add an article to a redirected category.<ref>For an attempt to fix this issue in [[MediaWiki]], {{crossref|pw=y|see {{Phab|T5311}}}}.</ref> Instead, a form of "'''[[Wikipedia:Soft redirect|soft redirect]]'''" may be used in limited circumstances. You can create a [[Wikipedia:Category redirects|category redirect]] by adding {{tlx|Category redirect|target}} to the category page. [[Wikipedia:Bots|Bots]] patrol these categories and move articles to the "target" of the redirect. If you need to add an [[WP:RCAT|rcat]] to a {{t|Category redirect}}, use the template's second parameter. For example, <syntaxhighlight inline lang="wikitext">{{Category redirect | Years of the 19th century in Ceylon | {{R from category navigation}} {{R from template-generated category}} }}</syntaxhighlight> Category redirects are [[WP:COSTLY|costly]]. While placing a page in a category redirect is not a ''big'' problem, it <em>is</em> a problem. There are [[Wikipedia:Category redirects that should be kept#Category redirects that might be useful|plenty of helpful uses of category redirects]], but category redirects are not as [[WP:CHEAP|cheap as regular redirects]]. Links to article redirects are [[WP:NOTBROKEN|not broken]]: i.e. click on the link and you are automatically redirected to its target. However, links to category redirects <em>are</em> broken and need to be fixed, except when resolved by a template (i.e. the template generates categories using a pattern, and some of the resulting category names are intentionally resolved by the use of {{tl|resolve category redirect}} within the template, as in the Ceylon example above). Placing a page into a category redirect makes it show up in the category redirect β not its target β until a bot comes along and fixes the link.<section end=CATREDIRECT /> {{anchor|DISAMBIGCAT}}{{shortcut|WP:DISAMBIGCAT}}If the category was renamed because it is ambiguous, and categories exist for two or more meanings, then create a category [[Wikipedia:Disambiguation#Disambiguation pages|disambiguation page]] at the old name, using {{tl|category disambiguation}}. See also [[:Category:Disambiguation categories]] {{OOUI icon|information}} ''Note:'' usually only do this at an unused category name which is ambiguous, e.g. [[:Category:Lewis]]. If an ambiguous name is used for an active category because it is clearly the [[WP:PRIMARYTOPIC]], and there are only 1 or 2 others, then use a hatnote like the one at [[:Category:Lewes]]. For longer lists, we can also create pages such as [[:Category:Bedford (disambiguation)]]. {{anchor|HIDDENCAT}} ===Hiding categories=== {{Shortcut|WP:HIDDENCAT}}{{see also|mw:Help:Categories#Hidden categories}} In cases where, for technical reasons, administration categories appear directly on articles rather than talk pages, they should be made into '''hidden categories''', so that they are not displayed to readers. This rule does not apply to [[Wikipedia:Stub|stub]] categories or "uncategorized article" categories β these types are ''not'' hidden. To hide a category, add the template {{tlx|Wikipedia category|<nowiki>hidden=yes</nowiki>}} to the category page (the template uses the [[Wikipedia:Magic word|magic word]] <code><nowiki>__HIDDENCAT__</nowiki></code>). This also places the page in [[:Category:Hidden categories]]. A logged-in user may elect to view all hidden categories, by checking "Show hidden categories" on the "Appearance" tab of [[Special:Preferences|Preferences]]. Notice that "hidden" parent categories are never in fact hidden on category pages (although they are listed separately). Hidden categories are listed at the bottom when previewing. All users of the desktop version can see hidden categories for a page by clicking "Page information" under "Tools" in the left pane, or by editing the whole page with the source editor. {{anchor|TREE}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)