Changes

Jump to navigation Jump to search
rm remnant of historical documentation
{{Documentation subpage}}
{{High-risk| approximately 3760000 }}
{{Substitution|not}}
{{Lua|Module:Redirect template}}

This is a [[WP:META|meta template]] for standardising redirect category ([[WP:RCAT|rcat]]) templates. The message produced by this template is intended to be transcluded to redirect pages via rcats.

When transcluded into the namespace indicated by a parameter, it categorises that page according to the parameter. Since the sortings are made to hidden maintenance categories, an important message to editors about the categorization appears on the redirect.

==Usage==
Only use this template in rcats that are used to tag "hard" redirects. If used on soft redirects, such as category redirects, there may be unexpected results, because this template may prove to be unstable if used on a soft redirect.

The usual links that are present on a redirect page are the link to the target page, and category and interwiki links that apply to the redirect.

===Parameters===
All the parameters should be used, except that only one of either {{para|from}} or {{para|to}} needs to be used (both can be used) and {{para|printworthy|(yes or no)}} should be used when appropriate.

The parameter {{para|name|From example}} adds the text "'''From example''':" before "This is a redirect...". The text "From example" will be automatically linked to the redirect maintenance category that is populated by the {{para|category}} parameter.

The parameter {{para|from|another example}} adds the text "from another example." after "This is a redirect". The parameter {{para|to|a third example}} adds the text "to a third example." after "This is a redirect" (or after the ''from'' parameter's text if that is also used). Note that the full stop (period) is automatically placed at the end of the sentence, so if a full stop is typed in, then two full stops will appear at the end of the sentence. Please be mindful of this.

The parameter {{para|info|This is extra information.}} 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. In the {{para|info}} parameter, the full stop (period) is ''not'' automatic and must be typed in at the end of the sentence.

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:
* {{para|main category|Redirects from examples}}
* {{para|help category}}
* {{para|portal category}}
* {{para|talk category}} (for ''all'' talk namespaces)
* {{para|template category}}
* {{para|wikipedia category}}
* {{para|user category}}
* {{para|all category}} will add the specified category to redirect pages in any namespace.
* Parameters for other namespaces can be handled after this template. An example is {{tl|R to draft namespace}} where the {{tl|Draft other}} template is used to populate {{Cat|Redirects to the draft namespace}}.

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

The parameter {{para|printworthy}} will categorise main namespace pages into {{Cat|Printworthy redirects}} or to {{Cat|Unprintworthy redirects}} depending on whether the parameter equals "yes" or "no", respectively.

===Example===
<pre>
{{Redirect template
|name=From an initialism
|from=an initialism
|to=a related topic, such as the expansion of the initialism
|main category=Redirects from initialisms
}}<noinclude>
<!-- Place categories on /doc subpage; interwikis go to Wikidata. -->
{{Documentation}}
</noinclude>
</pre>

Used individually as in {{tl|R from initialism}} this produces:
{{R from initialism}}


Used with the {{tl|Redirect category shell}} template, this produces:

{{Rcat shell|{{R from initialism|nocat=true}}}}
::<small>''Note: the ''Redirect category shell'' template detects protection levels – in this example the fact that this template, ''Redirect template'', is template protected is automatically sensed and displayed. That protection notice will not appear when the documentation page is viewed, because that page is not protected from editing.''</small>

=== Incorrect usage ===
When an rcat equipped with this template tags a redirect in the wrong namespace, the following notice will be applied by the {{tl|Incorrect redirect template}} and will appear on the redirect page (it does appear when the edit is "previewed", so the rcat can be removed before the edit is actually saved):
{{Mbox
| type = content
| text = {{Error|The above [[WP:RCAT|rcat]] should only be used to categorize redirects that are in the ''{{{1}}}'' namespace.}}}}
where '''''{{red|{{{1}}}}}''''' is replaced by a link to the namespace specified by the rcat.

Also, the redirect will not populate the expected category of the rcat. If saved with the rcat, then the incorrectly tagged redirect will populate '''{{cat|Pages with templates in the wrong namespace}}''', ''instead''.

=== Usage note ===
It was found at {{tl|R from fictional character}} and {{tl|R from IMO number}} that parser functions, {{code|<nowiki>{{#if:...}} {{#ifeq:...}}</nowiki>}}, etc., when used ''within'' this template may yield unexpected results and undesired text on redirects. If parameters and such are wanted in an rcat, then test the results in the sandbox before actually going "live". If anomalies are noted, then place the parser function(s) ''outside'' (usually ''below'') the '''Redirect template''' and enclose it/them inside <code><nowiki><includeonly> </includeonly></nowiki></code> tags.

== See also ==
* {{tl|Redirect category shell/Comparison}}
* [[WP:REDCAT|How to categorize a redirect]]
* [[Wikipedia:Template messages/Redirect pages]]
* [[Wikipedia:WikiProject Redirect/Style guide|WikiProject Redirect/Style guide]]

{{R template index}}

<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
{{DEFAULTSORT:!}}
[[Category:Redirect templates| ]]
[[Category:Wikipedia metatemplates|Redirect template]]
[[Category:WikiProject Redirect templates|Redirect template]]

}}</includeonly>
Anonymous user

Navigation menu