Template:Ifexist not redirect/sandbox
Jump to navigation
Jump to search
![]() | This is the template sandbox page for Template:Ifexist not redirect (diff). See also the companion subpage for test cases. |
![]() | This template is used on 3,690,000+ pages, or roughly 918% 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. Transclusion count updated automatically (see documentation). |
![]() | This template uses Lua: |
Usage
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
Existing article (List of Doctor Who episodes (1963–1989)):
{{Ifexist not redirect|List of Doctor Who episodes (1963–1989)|true|false}}
: false{{#ifexist:List of Doctor Who episodes (1963–1989)|true|false}}
: false
Redirect (List of Daredevil episodes):
{{Ifexist not redirect|List of Daredevil episodes|yes|no}}
: no{{#ifexist:List of Daredevil episodes|yes|no}}
: no
Empty article (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 (Green Arrow episodes):
{{Ifexist not redirect|Green Arrow episodes|1|0}}
: 0{{#ifexist:Green Arrow episodes|1|0}}
: 0
Default output:
{{Ifexist not redirect|List of Doctor Who episodes (1963–1989)}}
:{{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. Please add categories to the /doc subpage. Subpages of this template. |