Jump to content

మూస:This is a redirect/doc

వికీపీడియా నుండి

This 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.

Used by itself with no parameters (for example {{This is a redirect}} or simply {{Redr}}), the template will appear as it does at the top of this page, and the redirect will populate ‹The template Cat is being considered for merging.› 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. Editors who monitor the Miscellaneous redirects category will check these on an equable basis and 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 up 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. The aliases (usually shortcut redirects) of any of the listed rcats may also be used, e.g., Ralterlang or in lower case, ralterlang. An rcat's aliases may be found in its documentation. So in the case of a redirect from a different language, the three basic choices are:

{{This is a redirect|R from alternative language}}
{{This is a redirect|from alternative language}}
{{This is a redirect|ralterlang}}

This template may be added to a redirect page in the following manner:

#REDIRECT [[(target page name)]]

{{This is a redirect||from short name|unprintworthy}}

Generally for good readability on the Edit screen, this template is placed on the third line of the redirect as follows:

#REDIRECT [[(target page name)]]
(please leave this line blank for emphasis and ease of reading by editors)
{{This is a redirect|from move|to section|printworthy}}
See also: section titled Mbox-based below.

Parameters – general usage

The main parameters, one through seven, are for redirect categorization templates (rcats) themselves. Apart from parameter e0= (that is a zero, not a letter), which provides an italicized TOPnote when needed, and parameters e1= through e7=, which may be used to clarify the editor's choice of category(ies), other parameters may be used as follows. This template transcludes whatever other template begins with "R ", followed by the parameter's text. For example:

{{This is a redirect|from airport code}}

...uses the rcat {{R from airport code}} and produces:

An error box may appear that will illustrate what happens if an editor uses an rcat in the wrong namespace. In addition to the error box, the redirect will not be sorted to the rcat's category; instead it will populate ‹The template Cat is being considered for merging.› Category:Pages with templates in the wrong namespace!
Also note that the examples on this page automatically detect that this template ("This is a redirect") is a protected template – it can only be edited by template editors and administrators. If the documentation page is viewed or edited, the template-protected notice does not appear, because the documentation page is not protected from editing.

If a template beginning with "R " is not found (for example, {{R R from airport code}} does not exist), then the transcluded template is whatever template that has the same title as the exact text given, so {{This is a redirect|R from airport code}} produces the same result as {{This is a redirect|from airport code}} (it will work with or without the leading "R").

Up to seven rcat templates can be transcluded. Parameters e0 through e7 are optional explanations, which may be used to justify the redirect and to clarify why a redirect category applies in each particular case.

{{This is a redirect
 |e0=This redirect is needed to aid searches.
 |from airport code
  |e1=* ''This airport code is rarely used anymore.''
 |from ambiguous page
  |e2=* '''Note:'''  ''The ambiguity is disambiguated.''
 |from London bus route
  |e3=* (uhm, OK, this is not really a London bus route.)
 |from Unicode
 |unprintworthy
 |e5=''Up to '''eight''' of these '''e#''' parameters may be used – the '''e0''' as a '''TOPnote''' as well as one for each different rcat.''
}}

produces:

Rcat parameters

[మార్చు]

In addition to this template's own seven parameters that allow it to hold up to seven different rcats, it accepts most or all of the parameters that rcats accept. Two types of rcat parameters will work in this template:

  • one unnamed parameter from each rcat, and
  • a second parameter from each rcat – the  2=  parameter.

This template will accept one optional unnamed parameter for each individual rcat used:

{{This is a redirect|from plural|p1=printworthy}}

This subdues the Unprintworthy redirects category to which {{R from plural}} defaults and populates the Printworthy redirects 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:

{{This is a redirect|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  en  for English.

Additionally, this template will accept the  2=  parameter (if there is one) from each rcat. This template uses  n#=  for any 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:

{{Redr|from misspelling|p1=(correct spelling)|n1=printworthy}}

   Note:  if used by itself the template would appear like this:
   {{R from misspelling|(correct spelling)|printworthy}}

"Redr" is an alias or shortcut for this template and "p1" is the unnamed parameter described above, in this case the correct spelling. The "n1" parameter can be used when a second rcat parameter,  2= , is needed. 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" sort, and the redirect will populate ‹The template Cat is being considered for merging.› 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 ("typo" is an alias/shortcut for "from misspelling", as in "{{Redr|typo}}"):

{{Redr|move|mod|typo|p3=(correct spelling)|n3=printworthy}}

An example of a "printworthy misspelling" can be found at {{R from misspelling}}.

Additional notes

[మార్చు]

The "to" parameter in this template that was used with {{R from alternative language}} has been deprecated. Use the n# parameter instead as follows:

{{Redr|ralterlang|p1=ja|n1=es}}

The above code will sort the redirect into two categories:

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

[మార్చు]

There are two ways to sort a redirect into the Miscellaneous redirects category. When the Redr template is used without any rcats, it will perform the miscellaneous sort:

{{Redr}}...

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)]]

{{Redr||printworthy}}

Monitors of the Miscellaneous redirects category will check the redirect, add other rcats if needed, and then exclude the empty first parameter by deleting one of the first two pipes.

Comparison

[మార్చు]

Template: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.

Mbox-based

[మార్చు]

మూస:Wikt 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 (or Redr) 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.