Jump to content

From Noumenapedia

Template:Redirect/doc

__EXPECTED_UNCONNECTED_PAGE__

This template produces a hatnote:

It is placed at the top of the article or section that is the primary topic of a redirect, and links to other topics that are ambiguous with the name of that redirect. This template is used instead of the generic {{for}} in order to reduce reader confusion.

An example would be when a user searches for the emperor Achilleus. However, the search term "Achilleus" redirects to the page titled Achilles (as in the mythical hero) because it is considered more likely the user were searching for the very well known hero than a relatively obscure emperor. Now, at the top of this Achilles page you will (among other things) find the following hatnote:

That text is this template in action.

Parameters

A <syntaxhighlight lang="wikitext" inline style="display: none;" />|text= option adds text to the end; note that this should only be used when truly necessary, when the other hatnote templates listed below don't suffice.

Examples

  • {{Redirect|Foo}} →
  • {{Redirect|REDIRECT||PAGE1}} →
  • {{Redirect|REDIRECT|USE1|PAGE1}} →
  • {{Redirect|REDIRECT|USE1|PAGE1|USE2|PAGE2|USE3|PAGE3}} →
  • {{Redirect|REDIRECT|USE1|PAGE1|and|PAGE2}} →
  • {{Redirect|REDIRECT|USE1|PAGE1|USE2|PAGE2|and|PAGE3}} →
  • {{Redirect|Achilleus|the Emperor with this name|Achilleus (emperor)|other uses|Achilles (disambiguation)}} (as used on the page Achilles) →

The <syntaxhighlight lang="wikitext" inline style="display: none;" />|selfref=yes option marks the entire hatnote as a Wikipedia self-reference, causing it to be omitted when the page content is reused outside of Wikipedia (see {{self reference}} and MOS:SELFREF for more details).

More complex uses

For more complex cases, other templates can be used:

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Redirect in articles based on its TemplateData.

TemplateData for Redirect

<templatedata> { "params": { "1": { "label": "Redirecting page", "description": "Name of page that redirects here", "type": "wiki-page-name", "required": true }, "2": { "label": "Use 1", "description": "Displayed as: \"For Use 1, see ...\". If left empty, defaults to \"For other uses, see ...\".", "type": "line", "required": false }, "3": { "label": "Target 1", "description": "Page to link to. Default is PAGENAME (disambiguation).", "type": "wiki-page-name", "required": false }, "4": { "label": "Use 2", "description": "Second use. Can be 'and' to give: \"For Use 1, see Target 1 and Target 2.\"", "type": "line", "required": false }, "5": { "label": "Target 2", "description": "Page to link second use to.", "type": "wiki-page-name", "required": false }, "6": { "label": "Use 3", "description": "Third use. Can be 'and'.", "type": "line", "required": false }, "7": { "label": "Target 3", "description": "Page to link third use to.", "type": "wiki-page-name", "required": false }, "text": { "label": "Custom text", "type": "line", "description": "Text to be appended to the end." }, "selfref": { "label": "Is self-reference?", "description": "Set to yes to make this hatnote invisible on e.g. printed versions, for WP:SELFREFs", "type": "boolean", "default": "no", "autovalue": "yes" } }, "description": "This template produces a hatnote similar to:\n\n\"Foo\" redirects here. For other uses, see Foo (disambiguation).", "format": "inline" } </templatedata>

See also

  • {{no redirect}}, {{-r}}
  • {{is redirect}}, returns yes/<blank>
  • {{Shortcut}}, for creating redirects primarily within the Wikipedia namespace that uses shorter names (e.g. MOS:SMALLCAPS or WP:AN).
  • Rcat functional index
  • Wikimedia Commons logo Lua error in Module:Commons_link at line 80: attempt to index field 'wikibase' (a nil value). at Wikimedia Commons.