ಟೆಂಪ್ಲೇಟು:Redirect template
- This is a redirect.
This template should not be substituted. |
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:
{{#ifeq:{{{embed}}}|yes|{{Redirect template}}|{{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:
{{This is a redirect|from initialism}}
{{R from initialism}}
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 |name=From example
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 |from=another example
adds the text "from another example" after "This is a redirect". The parameter |to=a third example
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 |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.
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:
|main category=Redirects from examples
,|help category=
,|portal category=
,|talk category=
(for all talk namespaces),|template category=
|wikipedia category=
or|user category=
.|all category=
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 |other category=
. 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 <includeonly></includeonly>
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 |printworthy=
will categorise main namespace pages into ವರ್ಗ:Printworthy redirects or ವರ್ಗ:Unprintworthy redirects depending on whether the parameter equals "yes" or "no", respectively.
Example
[ಬದಲಾಯಿಸಿ]{{#ifeq:{{{embed}}}|yes |{{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 }} |{{Redirect template |from=an '''[[:Category:Redirects from initialisms|initialism]]''' |to=a related topic, such as the expansion of the initialism <includeonly> |main category=Redirects from initialisms</includeonly> }} }}<noinclude> {{Documentation}} </noinclude>
Used individually as in {{R from initialism}}
this produces:
- This is a redirect from an initialism to a related topic, such as the expansion of the initialism.
The above rcat should only be used to categorize redirects that are in the main namespace. |
Used with the {{This is a redirect}}
template this produces:
This page is a redirect:
|
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:
The above Rcat should only be used to categorize redirects that are in the {{{1}}} namespace. |
where {{{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. The incorrectly tagged redirect will populate Category:Pages with templates in the wrong namespace, instead.
Usage note
[ಬದಲಾಯಿಸಿ]It was found at {{CharR to list entry}}
that the use of parser functions, {{#if:... {{#ifeq:...
, 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 <includeonly> </includeonly>
tags.