From Wikipedia, the free encyclopedia
This template determines whether the page it is used on is a redirect or not. If it is used on a redirect, it returns its first parameter. Otherwise, it returns its second parameter. Either could be absent or empty.
For example:
{{Redirect other |yes|no}}
will display yes
on a redirect and no
on a non-redirect (test: on this page, it says "no");
{{Redirect other |text}}
will display text
on a non-redirect, and nothing on a redirect (test: on this page, it says "text");
{{Redirect other |text}}
will display text
on a redirect, and nothing on a non-redirect (test: on this page, it says "").
Remember to place a "1=" and/or "2=" prefix on the arguments if they contain equals signs.
Template parameters[ Edit template data ]
This template prefers inline formatting of parameters.
Parameter Description Type Status On redirect 1
The text that's shown when the template is used on a redirect.
Unbalanced wikitext optional On non-redirect 2
The text that's shown when the template is used on a non-redirect.
Unbalanced wikitext optional
Namespace and pagename-detecting templates
Namespace
Pagename
When on basepage Detects and acts according to whether it is on a basepage or on any subpage (that is, a ../..
subpage).
When pagename is For pattern matching on the pagename.
Module:Page Can take apart and put together pagenames in several ways.
IP-talk Returns IP-user talkpage, registered-user talkpage or non-user talkpage.
IP-user other For detecting IP-user pages.
Subpage other Pagename has an after-slash part (not in mainspace)
Sandbox other Page is subpage /sandbox (template space)
Testcases other Page is subpage /testcases (template space)
Rootpage other Page is rootpage (vs. /subpage) (template space)
Others
Stub other Detects whether it is on a page with a stub template or not.
Redirect other Detects whether it is on a redirect or not.
If preview Detects whether page is viewed as a preview or not.
If IP Displays different content to IP users and logged-in users.
If autoconfirmed Displays different content to autoconfirmed and non-autoconfirmed users.
If extended confirmed Displays different content to extended confirmed and non-extended confirmed users.
If administrator Displays content only to admins.
If mobile Displays different content to mobile users and desktop users.
If dark Displays different content to dark mode users and light mode users.
Noscript Detects whether page is viewed with a JavaScript-capable client or not.