OODA WIKI:Categorizing redirects

From OODA WIKI
File:Redirect categorization symbol.svg
A symbol for redirect categories (rcats)

This is a OODA WIKI guideline for placing redirect pages into categories. It is intended to document current practice and suggest best practice in other areas, and indicate where categorization of redirects can be misleading.

When to categorize a redirect

Normal ("hard") redirects should be placed in one of several maintenance categories specifically for redirects. This should be done using categorization templates (rcats) such as {{R with Wikidata item}}.

Soft redirects usually should not be categorized by rcats. Use of {{Soft redirect with Wikidata item}} and {{R category with possibilities}} to tag soft-redirected categories are presently the only exceptions.

Redirects are not usually sorted to article categories; however, there are exceptions, as described below.

Categories just for redirects

There are a series of categories that are used only for redirects. Redirects are placed in categories by templates. These categories explain why the redirect exists, for example {{R from merge}} means it was created by a merge or {{R from alternative name}} means that the redirect is an alternative name for the main title.

These categories are only intended to contain redirects, and are helpful in keeping track of redirects and further subcategorizing them as needed. They include both redirects within main namespace and in other namespaces. They are often applied using templates, though such categories can also be created and populated directly. This categorization is intended for OODA WIKI editors, not readers.

For tables of redirect category templates, grouped both alphanumerically and by function, see OODA WIKI:Template index/Redirect pages. For the categorical list of such templates, see Category:Redirect templates. All the redirect categories are subcategories of Category:OODA WIKI redirects, which is not meant to contain any redirects directly and is purposely kept empty except for subcategories.

Article categories

There are some situations where placing a redirect in an article category is acceptable and can be helpful to users browsing through categories. The following are examples of some of these situations:

Redirects having a target that is incompatible with the category

Alternative names should not look out of place on a category page. This is often a way to satisfy disagreements over renaming an article when more than one name seems equally valid. The alternative name(s) becomes a redirect and gets categorized the same way as its target. Another example is when a single article covers things known by multiple names, such as a person who is known in multiple fields of endeavour under different names, a merged article about three different newspapers, or a sketch comedy television show whose name exists on OODA WIKI as a redirect to the comedy troupe that created it. In such a case, consideration needs to be given to which title should be reflected in an individual category.

Note that placing such a category on the target article, with the alternative title in pipetext, does not accomplish the desired purpose, as pipetext in a category link only affects how a title is ordered alphabetically, not how it actually appears.

Alternative names for articles

The primary function of the category system is to allow readers to browse through articles. The category system is often used like an alphabetical index. It is sometimes helpful for redirects from common alternative names to appear in the index list. Editors should consider whether alternative names should be mixed in with other names, or not. Sometimes an entirely new category is more appropriate (see Categorization of multiple taxonomies below).

Subtopic categorization

Some subtopics of articles have well-known names and, over time, may expand to become separate articles. Many articles cover several topics that have been combined. This can happen following a merge of several related articles. Often there are redirects pointing to these subtopics. These redirects can be categorized. In some cases, the categories for the redirects that point to the subtopics will be different than the categories for the entire article.

Categorization of multiple taxonomies

Some articles can be organized by more than one taxonomy. An example of this is the organization of animal and plant articles by common names and binomial name taxonomy. This is possible by categorizing the article one way and categorizing the redirect a different way. In this case, the alternative categorization of the redirect will not appear in the article unless it is manually added.

Categorization of list entries

Some well-organized lists have redirects pointing at their subsections. In such cases, categorization of the redirects can be an alternative way of browsing entries in a long list. It can also provide an alphabetical listing for lists that are not organised alphabetically, such as lists organised in a chronological order. Redirects to sections of minor character lists should generally only be categorized within that fictional setting, and not in the wider fictional categories.

How to categorize a redirect

A redirect may be categorized in the same way as for any other page; however, when it is possible to use redirect category templates (rcats), then these should be used. For clarity, all category links should be added at the end of the page on their own lines, after the redirect target link and rcat(s). Use of a blank line between the redirect target link and all rcats and category links promotes readability of the code.

#REDIRECT [[Xxy Yzz]]

{{Redirect category shell|
{{R from move}}
{{R printworthy}}
}}

{{DEFAULTSORT:Yzz, Xxy}}
[[Category:Aaa]]

The #REDIRECT [[Article title]] must come first, on the top line, and must start from the left margin. [[Category:...]]-type links may be placed on their own lines after the redirect target link. Redirect category (rcat) templates, {{R from...}}, {{R to ...}}, etc., the {{Redirect category shell}} (Rcat shell) template may be placed anywhere after the redirect on another line or lines, preferably the third line for readability. Those are usually placed before (above) content categories and empty lines are left between the types for readability.

The {{DEFAULTSORT:}} magic word can also be placed on redirects, for example, to ensure that a redirect title that begins with a person's given name will be sorted to their surname: {{DEFAULTSORT:Sprat, Jack}}

The {{Redirect category shell}} (Rcat shell) template may be used to group redirect categories. That template automatically senses protection levels and promotes a faster learning curve for new editors. See its documentation page and the comparison page for more information.

The redirect will appear in the specified categories in a style format that is different than non-redirects (by default, redirects appear in italics type, while non-redirects do not – see Technical note below).

Further examples
Example 1
– a redirect that targets page Xxy Yzz, which uses the {{R from former name}} and {{R printworthy}} rcats, and which is also sorted to article content categories Aaa and Bbb, may appear as follows:
#REDIRECT [[Xxy Yzz]]

{{Rcat shell|
{{R from former name}}
{{R printworthy}}
}}

{{DEFAULTSORT:Yzz, Xxy}}
[[Category:Aaa]]
[[Category:Bbb]]
When the title being redirected is a person's proper name, consensus is to modify the sort key from its default action, (usually sorted by {{PAGENAME}}, the redirect title in this case), to instead sort it by surname. The {{DEFAULTSORT:}} behaviour switch is used for this; for example, on the edit page of the George Walker Bush redirect, use {{DEFAULTSORT:Bush, George Walker}}, so that the page will appear alphabetized in the B's and not the G's of the various categories. Similarly, for titles beginning with a definite or indefinite article, such as "the" or "a" – for example in redirect The President of the United States, use {{DEFAULTSORT:President of the United States, The}}, so that the page will appear alphabetically in the P's (see OODA WIKI:Categorization of people#Ordering names in a category for more information). As with non-redirect pages, it should be positioned immediately before the article content categories:
For the Bruce Jenner redirect:
#REDIRECT [[Caitlyn Jenner]]

{{Rcat shell|
{{R from birth name}}
{{R printworthy}}
}}

{{DEFAULTSORT:Jenner, Bruce}}
[[Category:Athletes (track and field) at the 1975 Pan American Games]]
[[Category:Athletes (track and field) at the 1976 Summer Olympics]]
Category:Redirects from birth names is a subcategory of Category:Redirects from former names. Normally, the most specific subcategory is used on redirects rather than their parent categories.
Example 2
– a redirect to an article subsection titled "Header":
#REDIRECT [[Xxy Yzz#Header]]

{{Redirect category shell|
{{R to section}}
{{R printworthy}}
}}
also, when the above shell template is used, all its contents can be entered on one line as follows:
#REDIRECT [[Xxy Yzz#Header]]

{{Redirect category shell|{{R to section}}{{R printworthy}}}}
There are often very good reasons to choose to use Rcat shell rather than using rcats by themselves; these reasons are detailed on its documentation and comparison pages.
Example 3
– a redirect to an article that has an anchor titled "Anchor this" (see templates {{Anchor}}, {{Visible anchor}}, and

This template, often abbreviated as {{}}, is used to provide stylized formatting to template displays without actually using the template itself. The code generated will be displayed inline. For a multi-line output, see {{tj}}.

Parameters

With the exception of alttext, the named parameters are toggles that are either omitted (default in most cases) or activated (by being assigned a value such as "on", "yes", "true", "include", etc.). They may be included in any order (see Examples below). Certain templates have the parameter "on" by default; see the main table for all alternate options.

Parameter Action Use with
{{example}}
Default active
Default (without accessory parameters) {{example}}
brace Include braces as part of the template link {{example}} {{tlw}}/{{tn}}
braceinside Include innermost braces as part of the template link {{example}}
bold Renders the template link/name in bold {{example}} {{tlb}}, {{tlxb}}
code Display output using HTML ‎<code>...‎</code> tags (monospaced font) {{example}} {{tlc}}, {{Template link expanded}}, etc.
italic Display any parameters accompanying the template link/name in italics {{example|param}} {{tlxi}}
kbd Display output using HTML ‎<kbd>...‎</kbd> tags (monospaced font) {{example}}
nolink Don't render the template name as a link {{example}} {{tlf}}, {{tnull}}
nowrap Prevent the insertion of line breaks (word wrap) in the output {{example}}
nowrapname Prevent word wrapping in the output of template name/link (parameters will wrap if needed) {{example}}
plaincode Uses ‎<code style="border:none; background:transparent;">...‎</code> {{example}} {{tltss}}
subst Include a subst: prefix before the template link/name {{subst:example}} {{tls}}, {{tlxs}}, etc
alttext=[text] Replace [text] with the actual label to be displayed for the template link {{Other}} {{tla}}
_show_result Will also display the result of the template {{Min|7|-5}} → -5
_expand Will add a link to the expanded template page {{Min|7|-5}} [1]

Unnamed (Positional)

This template can take any number of unnamed parameters as parameters accompanying the template link (or name); see Examples below.

Examples

Code Output Remarks
{{Anchor comment|Banner}} Template:Anchor comment Template:Banner does not exist. (Non-existent template is redlinked.)
{{Anchor comment|Abc}} Template:Anchor comment Template:Abc exists.
{{Anchor comment|abC}} Template:Anchor comment Template names are case-sensitive
{{Anchor comment|abc}} Template:Anchor comment (but the first letter is case-insensitive).
{{Anchor comment|x0}} Template:Anchor comment no parameters
{{Anchor comment|x1|one}} Template:Anchor comment one parameter
{{Anchor comment|x2|one|two}} Template:Anchor comment two parameters
{{Anchor comment|x3|1|2|3|4|5|6|7|8|9|10}} Template:Anchor comment ten parameters
{{tlg|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}} Template:Anchor comment Unlimited parameters, as one ‎<nowiki>...‎</nowiki> string.
{{Anchor comment|x2||two||}} Template:Anchor comment Empty parameters are discarded.
{{Anchor comment|x0|code=on}} Template:Anchor comment <code> style
{{Anchor comment|x0|plaincode=on}} Template:Anchor comment plaincode style
{{Anchor comment|x0|kbd=on}} Template:Anchor comment <kbd> style
{{Anchor comment|x0|bold=on}} Template:Anchor comment bold link/name
{{Anchor comment|x1|one|italic=on}} Template:Anchor comment parameter(s) in italics
{{Anchor comment|x0|nolink=on}} Template:Anchor comment
{{Anchor comment|x0|subst=on}} Template:Anchor comment
{{Anchor comment|x0|brace=on}} Template:Anchor comment all braces in link
{{Anchor comment|x0|braceinside=on}} Template:Anchor comment inside braces in link
{{Anchor comment|x0|alttext=x0 link}} Template:Anchor comment
{{Anchor comment|x0|bold=on|code=on|brace=on}} Template:Anchor comment Combine multiple parameter settings.
{{tlg|x1|{{spaces}}one{{spaces}}}} Template:Anchor comment Using {{spaces}} before and after a parameter.
{{Anchor comment|x2|bold=on|code=on|one|two}} Template:Anchor comment Can combine named and anonymous parameters ...
{{Anchor comment|x2|one|two|bold=on|code=on}} Template:Anchor comment ... in any order ...
{{Anchor comment|x2|one|code=on|two|bold=on|three}} Template:Anchor comment ... even intermixed ...
{{Anchor comment|x2|one|code=on|two|bold=on|three|italic=on}} Template:Anchor comment ... with many configurations.
{{tlg|x1|x=u}} Template:Anchor comment = won't work
{{tlg|x1|x&#61;u}} Template:Anchor comment &#61; is okay
{{tlg|x1|x{{=}}u}} Template:Anchor comment {{=}} is okay (see Template:=)
{{tlg|x1|x<nowiki>=</nowiki>u}} Template:Anchor comment Sticky nowiki is okay.
{{Anchor comment|x2|3=two|2=one}} Template:Anchor comment
Right-to-left is okay
{{Anchor comment}} Anchor comment With no arguments, it emits the current page name without braces.
{{Anchor comment|x2|3=one|4=two}} Template:Anchor comment Null parameter stops parsing.
Wrapping of long names (default)
Code Output
{{Anchor comment|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}} Template:Anchor comment
Wrapping of long names (nowrap=on)
Code Output
{{Anchor comment|nowrap=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} Template:Anchor comment
Wrapping of long names (nowrapname=on)
Code Output
{{Anchor comment|nowrapname=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} Template:Anchor comment

See also

General-purpose formatting

Comparison of template-linking templates according to the styles of generated text and link produced
Text style ↓ {{tlg}} options[note 1]
to achieve text style
Link style
Linked Unlinked Linked with subst Unlinked with subst Linked including braces Linked with alternative text
{{tlg}} options[note 1]
to achieve link style
DEFAULT nolink=yes subst=yes nolink=yes|subst=yes braceinside=yes alttext=Foo
2=Foo
normal DEFAULT {{tlg}}[note 1]
{{tl}}
{{tlp|1|2|...}}[note 2]
{{Template:tlu}}[note 3]
{{tlf}}[note 2]
<template link>
Template loop detected: Template:Tls
{{subst:Template:tlsu}}[note 3]
{{subst:tlsf}}[note 2]
<template link>
{{tn}} {{tla}}
code code=yes {{tl2}}
{{tlx}}
{{Template:tlxu}}[note 3]
{{tlc}}[note 2]
<template link>
{{tnull}}<template link>
{{subst:tlxs}} {{subst:tlsc}}[note 2]
<template link>
monospace plaincode=yes[note 4] {{subst:tltss}}[note 5]
kbd kbd=yes[note 5]
bold bold=yes {{tlb}}
bold+code bold=yes|code=yes {{tlxb}}
italic+code italic=yes|code=yes {{tlxi}}
  1. 1.0 1.1 1.2 {{tlg}} is the most general template, allowing any combination of text style and/or link style options.
  2. 2.0 2.1 2.2 2.3 2.4 Prevents wrapping of text by placing it inside ‎<span class="nowrap">...‎</span> tags.
  3. 3.0 3.1 3.2 Allows links to templates in any namespace.
  4. {{tlg|plaincode=yes}} uses ‎<code style="border:none; background-color:transparent;">...‎</code>.
  5. 5.0 5.1 Displays monospaced font using ‎<span style="font-family:monospace;">...‎</span>.

Other formatting templates

Templates producing specialised formatting effects for given templates, modules or parameters
Code example Effect Notes
{{Tj|Hatnote|Some text|selfref: yes|category: no|lang: fr}}
{{Hatnote
| Some text
| selfref = yes
| category = no
| lang = fr
}}
Supports colors, placeholder texts, named and unnamed parameters
<syntaxhighlight lang="wikitext">
{{Hatnote
   | Some text
   | selfref = yes
   | category = no
   | lang = fr
}}
</syntaxhighlight>
{{Hatnote
    | Some text
    | selfref = yes
    | category = no
    | lang = fr
}}
Same as above
{{Tji|Hatnote|Some text|selfref: yes|category: no|lang: fr}} {{Hatnote|Some text|selfref=yes|category=no|lang=fr}} Supports colors, placeholder texts, named and unnamed parameters
<syntaxhighlight lang="wikitext" inline>{{Hatnote|Some text|selfref=yes|category=no|lang=fr}}</syntaxhighlight> {{Hatnote|Some text|selfref=yes|category=no|lang=fr}} Same as above
{{tl2|Hatnote|lang=fr}} {{hatnote}} Supports linking to sister projects (e.g., fr:Hatnote)
{{demo|<nowiki>{{Hatnote|lang=fr|Some text}}</nowiki>}}
{{hatnote|lang=fr|Some text}}
Shows code and example
{{tln|Hatnote}} Template:Hatnote Produces a normal link to the template
{{elc|Template:Hatnote}}
{{elc|Template:Hatnote|Hatnote}}
[[Template:Hatnote]]
[[Template:Hatnote|Hatnote]]
Formats wikilink, with optional piped link text and blended suffix
{{ml|Example|hello}} {{#invoke:Example|hello}} Counterpart to {{tl}} for linking to Lua modules
{{mfl|Example|hello}} {{#invoke:Example|hello}} Similar to {{ml}}, but expects the function to be documented and creates a link to the corresponding section
{{mlx|Example|hello}} {{#invoke:Example|hello}} Counterpart to {{tlx}} for linking to Lua modules
{{ml-lua|Module:Example|hello}} require('Module:Example') Link to Lua modules and built-in libraries, showing Lua code.
{{para|title|<var>book title</var>}} |title=book title Formats template parameters for display, with or without values
{{sclx|LASTING}} [[WP:LASTING]] Takes a shortcut suffix in project namespace and displays it with brackets and the WP: alias in a ‎<code>...‎</code> tag.
{{tag|ref}}
{{xtag|templatedata}}
‎<ref>...‎</ref>
<templatedata>
Formats [X]HTML tags; can add content, choose opening, closing, or self-closing
{{dtl|Ping project}} {{d:Ping project}} Wikidata counterpart to {{tl}}
{{pf|if}}
{{pf|if|{{{1}}}|true|false}}
{{#if}}
{{#if:{{{1}}}|true|false}}
Parser function equivalent to {{tl}}
{{magic word|uc:}} {{uc:}} Magic word links

With utility links

Templates producing utility links for a given template (Hatnote used here as example)
Code example Effect
{{lt|Hatnote}} [[Template:]] 
{{lts|Hatnote}} Template:Hatnote(edit talk links history)
{{t links|Hatnote}} {{Hatnote}} (edit talk history links # /subpages /doc /doc edit /sbox /sbox diff /test)
{{tfd links|Hatnote}} Template:Hatnote (talk · history · transclusions · logs · subpages)
{{tetl|Hatnote}} {{Hatnote}}
links talk edit
{{tsetl|Hatnote}} {{subst:Hatnote}}
 links talk edit
{{ti|Hatnote}} {{Hatnote}}
{{tic|Hatnote}} Template:Hatnote (talk links edit)
{{tim|Hatnote}} m:Template:Hatnote (backlinks edit)
{{tiw|Hatnote}} Template:Hatnote (backlinks edit)
{{tlt|Hatnote}} {{Hatnote}} (talk)
{{ttl|Hatnote}} {{Hatnote}} (t/l)
{{twlh|Hatnote}} Template:Hatnote (links, talk)
):
#REDIRECT [[Xxy Yzz#Anchor this]]

{{Redirect category shell|
{{R to anchor}}
{{R unprintworthy}}
}}
Example 4
– one common redirect need to a geology page titled Xxy Yzz, which uses the R to section rcat to point to the article and section where the common term is defined, and which should be in categories Aaa, Bbb, Ccc and Ddd (the parent article may be sorted to a few more, such as Eee, Fff, etc.), all of which are categories usually found in the parent article. Here is how this example would appear:
#REDIRECT [[Xxy Yzz#Section header]] 

{{Rcat shell|
{{R to section}}
{{R to related topic}}
{{R printworthy}}
}}

[[Category:Aaa|{{PAGENAME:Xxy Yzz}}]]
[[Category:Bbb|{{PAGENAME:Xxy Yzz}}]]
[[Category:Ccc|{{PAGENAME:Xxy Yzz}}]]
[[Category:Ddd|{{PAGENAME:Xxy Yzz}}]]


Notes
  1. Crucial note: If the Redirect category shell (Rcat shell) template is placed on the first line, the same line as the redirect target, there are usually unexpected and peculiar results. HTML Tidy may interfere with the templates and cause them to appear in abnormal and unexpected ways when saved. Just be careful to put these templates on the third line beginning at the far left margin of the edit screen.
  2. {{PAGENAME}} is one of several "magic words" (magic words are different from templates) in wikimarkup language. It fills in the pagename (without the namespace) of the redirect unless the pagename of the target page (without namespace) is entered as its first parameter. The first category parameter represented by |{{PAGENAME:Xxy Yzz}} (note that the colon ( : ) is used to pass parameters in magic words rather than the pipe ( | ) symbol that is used in templates) above is in fact the sort key used to group pages together in a category list.
  3. When the Redirect category shell (Rcat shell) template is used, each rcat can pass its own parameters, whether named or numbered, in the normal manner, and without concern for what position the rcat holds within the shell template.
  4. As shown above, printworthiness is an important type of sort. We are told in the style guide, "The ultimate goal of the guide is to have every redirect categorised in a standard format, as well as to have every main-namespace redirect categorised as either printworthy or unprintworthy." It is important to note that this only applies to main article namespace redirects and not to redirects in any other namespace.
  5. For more detailed information about how to categorize redirects please see the documentation for individual rcats, and the Redirect category shell template.
 General information note
ALL the {{R from...}}, {{R to...}}, etc., templates have as their main purpose to populate a redirect subcategory (see Category:OODA WIKI redirects) to aid in maintenance. A second goal is to help editors with concise explanations for such sortings. Generally speaking, one such template categorizes redirect pages to the subcategory, though that template may be "aliased" by use of several alternative phrasings, themselves redirects to the template. Common alias choices are: other vs. alternative, capitalization vs. capitalisation and other such spelling/phrasing variants like "R to singular" vs. "R from plural" and "R from singular" vs. "R to plural".

Technical note

The appearance of a redirect link on category pages and in search results is determined by the CSS class "redirect-in-category" and the specification for that class in MediaWiki:Common.css. By default, this class is set to "italics", although this may be changed by the user. In the past, no distinction was made for users, which fueled the controversies over how to categorize redirects. By displaying them in italics, redirects are easy to pick out. Perfectly good (and in many cases better known) terminology implemented as redirects for technical reasons can now be categorized for the readers to browse, and for editors to know and use as needed.

See also

fr:Aide:Redirection (wikicode, avancé)#Catégoriser une redirection