Template:Redirect template/doc

This is a template for standardising redirect templates. The message produced by this template is intended to be transcluded onto redirect pages via redirect category (Rcat) templates.

When transcluded into the namespace indicated by a parameter, it categorises that page according to the parameter.

Usage
Only use this template in other redirect templates for hard redirects.

The only links that should be present on a redirect page are the link to the target page, and category and interwiki links that apply to the redirect. Other links on redirect pages cause problems with "What links here".

This template should be used twice in a redirect template:

The first instance of this template will appear when used with the This is a redirect template, whereas the second instance will appear when the redirect template is used individually:

Parameters
All the parameters should be used, except only one of either from or to needs to be used (both can be used) and printworthy should only be used where applicable. All parameters except name should be used in both halves of the redirect template. The parameters used in both halves should be identical (apart from a link in from or to).

When the "This is a redirect" template is used, the parameter  adds the text "From example:" before "This is a redirect...". The text "From example" will be automatically linked to the redirect category that is populated by the redirect template. This "name" parameter should be used only in the first half of the redirect template.

The parameter  adds the text "from another example" after "This is a redirect". The parameter  adds the text "to a third example" after "This is a redirect" (or after the from parameter if that is also used). In the second half, one of these two parameters should contain a bolded link to the category that is populated by the redirect template.

The parameter  produces the text "This is extra information." after the first sentence, allowing extra information about the type of redirect to be displayed, if necessary. Too much extra information should be avoided, as it can be included on the corresponding category page instead.

The category parameters add pages with redirect templates using this template to categories. Use the parameter for the namespace the template will be used in:
 * (for all talk namespaces),
 * or
 * adds the category to pages in any namespace.
 * Parameters for other namespaces do not exist because no hard redirects should exist to or from those namespaces.
 * or
 * adds the category to pages in any namespace.
 * Parameters for other namespaces do not exist because no hard redirects should exist to or from those namespaces.
 * adds the category to pages in any namespace.
 * Parameters for other namespaces do not exist because no hard redirects should exist to or from those namespaces.

A namespace parameter can be used in conjunction with. This parameter will add its category to pages in any namespace other than the specified namespace parameter's category.

The category parameters in the second half should be wrapped in  tags to stop the redirect template itself from being placed in the categories or the Incorrect redirect template message box appearing on the redirect template page. Do not "includeonly" the parameters in the first half, because it will prevent the link from being added to the text created by the name parameter.

The parameter  (valid only for Redirect template, not for Redirect template/core) will categorise main namespace pages into Category:Printworthy redirects or Category:Unprintworthy redirects depending on whether the parameter equals "yes" or "no", respectively.

Example
Used individually as in R from initialism this produces:

Used with the This is a redirect template this produces:


 *  Note: Template "This is a redirect" detects protection levels – in this example it senses that "Redirect template" is template protected. That notice does not appear when the documentation page is viewed, because that page is not protected from editing. 

Incorrect usage
When an Rcat equipped with this template tags a redirect in the wrong namespace, the following notice will be seen on the redirect page:

where  is replaced by a link to the namespace specified by the Rcat.

Also, the redirect will not populate the expected category of the Rcat. The incorrectly tagged redirect will populate , instead.

Usage note
It was found at CharR to list entry that the use of parser functions,, etc., within this template may yield unexpected/undesired text on redirects. If parameters are desired for an Rcat, place parser functions outside the Redirect template enclosed with  tags.

Technical note
This template calls Redirect template/core, which is used to prevent a template loop caused by printworthiness code. For more information, see the talk page discussion.