• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Is redirect/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Is redirect
This is the template sandbox page for Template:Is redirect (diff).
See also the companion subpage for test cases.
Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 360,000 pages, or roughly 1% of all pages.
To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them.
This template uses Lua:
  • Module:Pagetype (sandbox)

Returns yes when |1=somepagename is a redirect, and a <blank space> when not a redirect.

For illustration purposes, in this documentation redirect pages are in italics: Mainpage → Main_Page

Expect 'yes': {{Is redirect|Autism spectrum}} → yes
Expect '<blank>' (no): {{Is redirect|Autism}} →

Contents

  • 1 Talkpage handling
  • 2 Usage
  • 3 Template Data
  • 4 See also

Talkpage handling

edit

By default, a check specifying a talk page is performed on the corresponding subject page (its associated page in mainspace, or in Template space, etc.).

To check the talkpage itself, both use |talk=yes and the talk page name.
{{Is redirect|Talk:Autism spectrum|talk=yes}} →

Background. By default, when entering a Talkpage to check (like Talk:Autism spectrum), the check is performed on the subject page. This stems from the module used. For example:

Page to check: Talk:Autism spectrum: {{Is redirect|Talk:Autism spectrum}}
Current pages status: Autism spectrumAutism spectrum is a redirect, Talk:Autism spectrum is not a redirect (it has content).
{{Is redirect}} returns:
{{Is redirect|Autism spectrum}} → yes Green tickY
{{Is redirect|Talk:Autism spectrum}} → yes Question? (unexpected for the talkpage itself)
Applying Talk:Autism:
{{Is redirect|Talk:Autism spectrum|talk=yes}} → Green tickY
Applying the subject page Autism:
{{Is redirect|Autism spectrum|talk=yes}} → yes Green tickY (|talk=yes for a subject page name checks the subject page, not the associated talk page)

Usage

edit
  • Main Page (expect neg): {{is redirect|Main_Page}} →
  • MainpageMainpage (expect yes): {{is redirect|Mainpage}} → yes

Can be used as:

{{#if:{{Is redirect|somepagename}} |value when yes |value when no}}

Template Data

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

TemplateData for Is redirect

Returns "yes" or <blank> (for no) for the pagename entered

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
11

no description

Unknownoptional
Check Talktalk

By default, the subject page is checked

Default
no
Booleanoptional

See also

edit
  • {{no redirect}}, {{-r}} — link to the redirect page itself, not its target
  • {{target of}} — returns the target of a redirect
  • {{redirect}} — hatnote "Foo redirects here ..."
  • {{Redirect and target}}
The above documentation is transcluded from Template:Is redirect/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Is_redirect/sandbox&oldid=1114282648"
Last edited on 5 October 2022, at 18:35

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 5 October 2022, at 18:35 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop