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 other redirect templates.

When transcluded into the namespace indicated by a parameter, it categorises that page according to the parameter. When transcluded into other templates, it places those templates into Category:All redirect templates. Therefore templates based on this one should not be used to tag redirect pages in the template namespace.

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 half of the template will appear when used with This is a redirect, whereas the second half will appear when used without This is a redirect.

Parameters
All the parameters are technically optional (the template will work and appear normal without them); however, the template is pointless without parameters. All the parameters should be used, except only one of from and 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 template. Preferably, the parameters used in both halves should be identical (apart from a link in from or to).

The parameter  adds the text "From example:" before "This is a redirect". The text will be automatically linked to the redirect category corresponding to the redirect template. This parameter should be use only in the first half.

The parameter  adds the text "from example" after "This is a redirect". The parameter  adds the text "to example" after "This is a redirect" or the from parameter if that is also used. One of these two parameters should contain a bolded link to the redirect template's corresponding category in the second half.

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. Multiple category parameters may be used but it is unlikely that this will ever be necessary. 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. Do not use this parameter if multiple namespace parameters have been used.

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

The parameter  will categorise main namespace pages into Category:Printworthy redirects or Category:Unprintworthy redirects depending whether the parameter equals "yes" or "no", respectively.

Example
used by itself produces:

used with This is a redirect produces:

Categorisation of redirect templates
This template automatically adds templates it is transcluded on to Category:All redirect templates, except sub-pages named "doc" (to avoid adding the category to documentation sub-pages of templates which contain examples of this template or redirect templates using this template). At the moment, the category is also added to template namespace pages that transclude redirect templates using this template. Until this setback has been fixed, this template should not be used on redirect templates that can be used on template namespace pages.

Templates, except sub-pages named "doc", using this template with the printworthy parameter will be automatically categorised into Category:Templates for printworthy redirects or Category:Templates for unprintworthy redirects depending on whether the parameter equals "yes" or "no". If the parameter is not used or it equals anything other than "yes" or "no", the template will not be added to one of these categories.