Template:ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ/doc
This template is used on 66,000+ pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
Template:Substitution Error: no shortcuts were specified and the |msg= parameter was not set.
This template may be used to add from one to seven appropriate redirect category (rcat) templates, along with their parameters, to redirects. Additionally, this template automatically senses and categorizes protection levels. For more information, see the page below and follow the "Manifold sort" category link above.
Purpose
editThis template is based on a proposal to standardize redirect templates (rcats). Its basic purpose is to simplify the process of tagging and categorizing redirects.
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 removed, then the protection-related rcats and category(ies) will also be (automatically) removed from the redirect.
[Mbox note 1]
[Printworthiness note 1]
This template can categorize and display the text (with parameters if needed) of from 1 to 7 rcats.
Usage
editUsed by itself with no parameters, for example, {{This is a redirect}}
, the template will appear as it does at the top of this page, and the redirect will populate Category:Miscellaneous redirects. 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 Wikipedia: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:
{{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ |1=(rcat name) |2=(second rcat name) |3=(third rcat name) |4=(fourth rcat name) |5=(fifth rcat name) |6=(sixth rcat name) |7=(seventh rcat name) }}
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:
{{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ|(rcat name)|(second rcat name)|(third rcat name)|(fourth rcat name)|(fifth rcat name)|(sixth rcat name)|(seventh rcat name)}}
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:
#REDIRECT [[(target page name)]] {{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ||from short name|unprintworthy}}
- 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 Category:Miscellaneous redirects in addition to other rcats that are used. In this case the Template:C and Template:C 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: (please leave this line blank for emphasis and ease of reading by editors)
Line 3: {{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ|from move|to section|printworthy}}
- See also: section titled Mbox-based below.
Parameters
editThe 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 may be used to give an explanation of an editor's choice of category(ies), other parameters may be used as follows: Template:NbspThis template transcludes any template that begins with "R " (all rcats begin with "R ") by using the rest of that template's text. For example:
{{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ|from airport code}}
...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 Category:Pages with templates in the wrong namespace! 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, {{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ|italic title}}
, 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:
- {{This is a redirect|R from airport code}}
- produces the exact same result as:
- {{This is a redirect|from airport code}} (it works with or without the leading "R ").
From one to seven templates can be transcluded. Parameters |e0=
through |e7=
are used for optional explanations that may justify the redirect or clarify why a redirect category applies for each particular redirect. The |e#=
parameter is numbered according to which rcat it explains – if it explains the first rcat, then |e1=
is used, or if it explains the sixth rcat, then |e6=
is used. Again the |e#=
parameters are optional and, when used, their sequence must coincide with the rcats they explain:
explanation parameters
edit{{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ |e0=See '''{{-r|(Other redirect title)}}''' for printworthy redirect. |from airport code |e1=* ''This airport code has been discontinued.'' |from ambiguous page |e2=* '''Note:''' ''The ambiguity is easily disambiguated.'' |from London bus route |e3=* (This bus route is to and from Maidenhead.) |from Unicode |unprintworthy |e5=* ''Up to '''eight''' of these '''{{para|e#}}''' parameters may be used – the '''{{para|e0}}''' as a '''TOP note''' as well as one {{para|e#}} parameter for each different rcat.'' }}
produces:
ਇਹ ਇੱਕ redirect:
|
- Notes: The above is only for illustration, as no single redirect would be tagged by all of these rcats together. Also, the "Template protected" may appear in this case only because this This is a redirect template page itself is template protected. In addition, note that an asterisk (*) may be used to indent and bullet the explanations.
Rcat parameters
editIn addition to this template's own seven parameters that allow it to hold from one to seven different rcats, it accepts most or all of the parameters that rcats accept. Two rcat parameters, when needed, will work in this template:
- one unnamed parameter,
|1=
, from each rcat (|p#=
in this template), and - a second parameter from each rcat, the
|2=
parameter (|n#=
in this template).
This template will accept two optional unnamed parameters for each individual rcat used. An example of one parameter used follows:
{{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ|from plural|p1=printworthy}}
This subdues the Template:C category to which {{R from plural}} defaults and populates the Template:C category instead. This template will hold up to seven rcats, so there are also seven respective "p" parameters, p1, p2, p3, ... p7
. Which position the rcat holds will determine the "p" number to use, so the sequence is again very important:
{{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ|from move|mod|nick|ralterlang|p4=en|rcon|from plural|p6=printworthy}}
In the above example, "from plural" ({{R from plural}}) is the sixth and final rcat, so "p6" is used to make the redirect "printworthy". Since "ralterlang" ({{R from alternative language}}) holds the 4th position, "p4" is used for the ISO 639 code of the source language, in this case Template:NbspenTemplate:Nbsp
for English.
Additionally, this template will accept the |2=
parameter (if there is one) from an rcat. This template uses |n#=
to represent an rcat's |2=
parameter. For example, if a redirect exists that is a misspelling of a title, it can be tagged with {{R from misspelling}} in the following manner:
{{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ|from misspelling|p1=(correct spelling if needed)|n1=printworthy}}
In this case |p1=
is the correct spelling (used only if the target of the redirect is not the correct spelling). The |n1=
parameter can be used when a second rcat parameter is added. Some misspellings may be helpful in a printed version of Wikipedia, so the second parameter in "R from misspelling" above is used to subdue its default "unprintworthy" category sort, and the redirect will populate Category:Printworthy redirects instead. As with the |p#=
parameters, there are seven |n#=
parameters, n1, n2, n3, ... n7
, one for each of the seven positions in this template. Just as with the |e#=
and |p#=
parameters, the sequence is important, so if an edit changes the rcat sequence, and the letter parameters have been previously added, then the |e#=
, the |p#=
and the |n#=
parameters must be checked to ensure they still correspond to the correct rcats:
{{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ|from move|from misspelling|p2=(correct spelling)|n2=printworthy|printworthy}}
If an editor wants to add the {{R from modification}} rcat to the above, and it is added after the "p" and "n" parameters, then nothing else needs to be changed:
{{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ|from move|from misspelling|p2=(correct spelling)|n2=printworthy|from modification|printworthy}}
If, however, that rcat is added "in front of" the {{R from misspelling}} rcat, then the "p" and "n" parameters must also be edited:
{{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ|from move|from modification|from misspelling|p3=(correct spelling)|n3=printworthy|printworthy}}
An example of a "printworthy misspelling" can be found at template {{R from misspelling}}.
Additional notes
editThe |to=
parameter in this template that was used with {{R from alternative language}} has been deprecated. Use the |n#=
parameter instead as follows:
{{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ|from alternative language|p1=ja|n1=es}}
The above code will sort the redirect into two categories:
- Template:C (p1=ja), and
- Template:C (n1=es).
This template's wiki markup that invokes the |to=
parameter should stay in place and not be removed until the remaining redirects that use that parameter in this template have been modified.
When used alone
editThere are two ways to sort a redirect into the Template:C category. When this template is used without any rcats, it will perform the miscellaneous sort:
{{This is a redirect}}
...
ਇਹ ਇੱਕ redirect:
|
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 → ||
):
#REDIRECT [[(target page name)]] {{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ||from subtopic|printworthy}}
Monitors of the Miscellaneous redirects category will check the redirect, add other rcats if needed and then remove the empty first parameter.
Comparison
editTemplate: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
editThis template may also carry and hold other templates 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:
{{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ|from move|from alternative name|Italic title|DEFAULTSORT:Hobbit, The}}
Note that curly brackets should not be used within this template.
Notes
editMbox note
- ↑ When the wikimarkup code of this template is opened, it is seen that this is an "mbox-based" template. "Mbox" stands for "multi namespace message box", which is a meta-template that works in all namespaces. There can be a problem with this mbox unless editors are careful to place This is a redirect on its own line at the very beginning of the line. If this is done then all is well; if this is not done, then HTML Tidy may interfere with the mbox and cause this template to appear in an abnormal and unexpected manner when saved. So be careful where you leave this template placed in a redirect's Edit screen, take another look at the above readability guide, and be sure to preview your edits – all your edits.
#REDIRECT [[(target page)]] {{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ||unprintworthy}}
- Not correct:
#REDIRECT [[(target page)]] {{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ||unprintworthy}}
- A blank line is usually placed between the redirect target and this template to make the Edit screen easier to read.
Printworthiness note Template:See also
- ↑ Where the printworthiness of a mainspace redirect is concerned, there are three kinds of rcats:
- those that populate the Template:C category by default,
- those that populate the Template:C category by default, and
- those that do not default to either of the above, and which leave it to the editor to decide based upon best knowledge whether or not a mainspace redirect is suitable for a printed or DVD version of Wikipedia.
{{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ|from ambiguous term}}
...then the hidden categories populated will be Template:C and Template:C, and these will appear at the bottom of the redirect page only to registered users who are logged in and who have set their preferences to see hidden categories. The mbox that will appear to all readers would look like:
ਇਹ ਇੱਕ redirect: Template:From ambiguous term/demo
- For more information follow the boldface category link(s). This template automates protection levels.
If an editor wants the printworthiness category to appear in the mbox, then the redirect must be tagged as follows:
{{ਇਹ ਇੱਕ ਰੀਡਾਇਰੈਕਟ ਹੈ|from ambiguous term|unprintworthy}}
...which produces:
ਇਹ ਇੱਕ redirect: Template:From ambiguous term/demoTemplate:Unprintworthy
- For more information follow the boldface category link(s). This template automates protection levels.
Only then will the printability, printworthy or unprintworthy, be described within this template's mbox on the redirect page.
See also
edit- {{Talk page of a redirect}}, an alternative to a redirect when a talk page has already been created
- Template:This is a redirect/code, original explanations of this template's early code
- Wikipedia:Protection policy, for questions related to this template's ability to detect protection levels
- Wikipedia:Template messages/Redirect pages, a functional and an alphabetical index of rcats
- WikiProject Redirect/Style guide