Template:This is a redirect/doc

This template may be used to add from one to seven appropriate redirect category (rcat) templates to redirects. Additionally, this template automatically senses, describes and categorizes protection levels. A third important function is to help editors learn more about redirect categorization by use of the. For more information, see the page below and follow the boldface category link above.

Purpose
This template is based on a proposal to standardize redirect templates (rcats). Its basic purpose is to simplify the process of tagging and categorizing redirects.

Like the Redirect category shell template, this template is also able to help newer contributors learn the redirect category system. Details of this part of the purpose of this shell template may be found in the When used alone section below.

Protection levels are automatically detected by this template by use of pp-protected and pp-move. When edit protection or move protection (or both) is applied to a redirect that has been tagged with this template, the protection level is automatically detected, and the redirect will be tagged with a protection rcat and sorted to the appropriate protection-related category(ies). When protection is altered or removed, then the protection-related rcats and category(ies) will also be (automatically) changed or removed from the redirect.

This template can categorize and display the text (with parameters if needed) of from 1 to 7 rcats.

Usage
Used by itself with no parameters, for example,, the template will appear as it does at the top of this page, and the redirect will populate. That category will also be populated if the first parameter is left empty while rcats occupy the second, third, and so on. This is useful when an editor adds rcats and yet feels unsure that there may be at least one other rcat with category that may be used to tag the redirect. Monitors of the Miscellaneous redirects category will then help decide if another rcat(s) is needed. Then the empty first parameter may be excluded by removing either the first or second pipe. That will remove the redirect from Category:Miscellaneous redirects. See below for more information.

This template may hold from one to seven different redirect category (rcat) templates. The choices for editors are listed at WikiDevi:Template messages/Redirect pages both alphabetically and by function. Any of those rcats may be used either with their full name, e.g., R from alternative language, or with the omission of the first "R", as in from alternative language. Aliases (usually shortcut redirects) of any of the listed rcats may also be used and will be found in each rcat's documentation.

The seven "main" parameters may be used as follows:

As with all templates that have unnamed (numbered) parameters, the numbers and equal signs may be omitted. The above can be further condensed by typing everything on the same line:

The actual sequence of rcats is left to editors – there is no priority as to which rcat should be "first" and which rcats should "follow" in any particular order. The next example that shows an empty first parameter is one time that the sequence becomes important.

This template may be added to a redirect page in the following manner:
 * 1) REDIRECT (target page name)


 * Note the double pipe between "redirect" and "from" above, which indicates an empty first parameter. Leave the first parameter empty to sort a redirect to  in addition to other rcats that are used.  In this case the  and  categories will also be populated.  Monitors of the "Miscellaneous redirects" category will help editors when needed.

Generally for good readability on the edit screen, this template is placed on the third line of that screen as follows: Line 1: #REDIRECT (target page name) Line 2: Line 3:
 * See also: section titled Mbox note below.

Parameters
The main parameters, one through seven, are for redirect categorization templates (rcats) themselves. Apart from parameter e0 ("e-zero"), which provides an italicized TOP note when needed, and parameters e1 through e7, which have been deprecated, other parameters may be used as follows: This template transcludes any template that begins with "R " (all rcats begin with "R ") by using the rest of that template's text. For example:

...uses the rcat R from airport code and produces:


 * An error box appears that illustrates what happens if an editor uses an rcat in the wrong namespace. Correct namespaces are found on individual rcat documentation pages.  In addition to the error box, the redirect will not be sorted to the rcat's category; instead it will populate ! If an error box appears when an edit is previewed, then appropriate changes can be made before'' the page is actually saved.

If a template beginning with "R " is not found, for example,, then the transcluded template is whatever template that has the same title as the exact text given. In the above example, the Italic title template would be transcluded and would italicize the title of the redirect. This also means that:
 * produces the exact same result as:
 * (it works with or without the leading "R ").
 * (it works with or without the leading "R ").

From one to seven templates can be transcluded. Parameter e0 can provide a hatnote, and parameters e1 through e7 have been deprecated.

Rcat parameters
This template no longer accepts individual rcat parameters. If rcat parameters are needed, then use the Rcat shell template instead.

To clarify, this template's parameters, p# and n#, have been deprecated and should no longer be used. When the Rcat shell template is used, each rcat may pass any of its parameters with no concern for its position in the shell template.

Deprecated parameters
The to parameter in this template that was used with R from alternative language has been deprecated. This template's wiki markup that invokes the to, p# and n# parameters, as well as the code for the e1 thru e7 parameters, should stay in this template and not be removed until and unless all of the tagged redirects that use this template with those parameters have been modified to use the Rcat shell template. If any of these parameters are removed from this template's code, many redirects would be broken.

When used alone
This template is designed to help contributors who are unfamiliar with categorizing redirects by enabling them to sort redirects into the monitored category. Do not hesitate to use this important function to help with sorting redirects to correct and appropriate categories.

There are two ways to sort a redirect into the category. When this template is used without any rcats, it will perform the miscellaneous sort:

...

Also, if one or more rcats are known, but an editor is unsure that there might be one or more other rcats that are needed, then leave the first parameter blank (type two pipes together ? ):
 * 1) REDIRECT (target page name)

Monitors of the Miscellaneous redirects category will check the redirect, add other rcats if needed and then remove the empty first parameter.

Comparison
Template:This is a redirect/Comparison shows the difference in the appearance of text between when individual rcats are used and when this template is used.

Other templates
This template may also carry and hold other templates and magic words within it as parameters. Even the DEFAULTSORT magic word and a sort key may be used either inside this template or below it. Another template commonly used within the Redr template is Italic title and its shortcut ital to denote titles that should be formatted in italics. Some rcats such as R from book and R from film automatically format the redirect names in italics. Any appropriate template may be used within this template in the following manner:

Note that curly brackets should not be used within this template.