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

Template:Ifexist not redirect/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Ifexist not redirect
This is the template sandbox page for Template:Ifexist not redirect (diff).
See also the companion subpage for test cases.
Template documentation[view] [edit] [history] [purge]
This template uses Lua:
  • Module:Redirect (sandbox)

Contents

  • 1 Usage
  • 2 Examples
    • 2.1 Existing article
    • 2.2 Redirect
    • 2.3 Empty article
    • 2.4 Non-existent article
    • 2.5 Default output

Usage

edit

The {{Ifexist not redirect}} template can be used to identify a page which exists, is not blank, and is not a redirect; whereas {{ifexist}} will only check whether the page exists.

Use the format {{Ifexist not redirect|page|return if true|return if false}}. The 2nd and 3rd parameters are used to define the output of the template if the condition is true or false, respectively. If not defined the default output is "yes" if true and empty if false.

Examples

edit

Existing article

edit
  • List of Doctor Who episodes (1963–1989)
{{Ifexist not redirect|List of Doctor Who episodes (1963–1989)|true|false}}

true

{{#ifexist:List of Doctor Who episodes (1963–1989)|true|false}}

true

Redirect

edit
  • List of Daredevil episodes
{{Ifexist not redirect|List of Daredevil episodes|yes|no}}

no

{{#ifexist:List of Daredevil episodes|yes|no}}

yes

Empty article

edit
  • Template:Ifexist not redirect/testpage
{{Ifexist not redirect|Template:Ifexist not redirect/testpage|yes|no}}

no

{{#ifexist:Template:Ifexist not redirect/testpage|yes|no}}

yes

Non-existent article

edit
  • Green Arrow episodes
{{Ifexist not redirect|Green Arrow episodes|1|0}}

0

{{#ifexist:Green Arrow episodes|1|0}}

0

Default output

edit
{{Ifexist not redirect|List of Doctor Who episodes (1963–1989)}}

yes

{{Ifexist not redirect|List of Daredevil episodes}}
The above documentation is transcluded from Template:Ifexist not 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:Ifexist_not_redirect/sandbox&oldid=720453615"
Last edited on 16 May 2016, at 00:08

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 16 May 2016, at 00:08 (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