Template:Ifexist not redirect
![]() | This template is used on approximately 1,380,000 pages, or roughly 8% 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: |
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 <syntaxhighlight lang="wikitext">return if true</syntaxhighlight>. 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
<syntaxhighlight lang="wikitext">true</syntaxhighlight> true <syntaxhighlight lang="wikitext">true</syntaxhighlight> true
Redirect
<syntaxhighlight lang="wikitext">no</syntaxhighlight> no <syntaxhighlight lang="wikitext">yes</syntaxhighlight> yes
Empty article
<syntaxhighlight lang="wikitext">no</syntaxhighlight> no <syntaxhighlight lang="wikitext">yes</syntaxhighlight> yes
Non-existent article
<syntaxhighlight lang="wikitext">0</syntaxhighlight> 0 <syntaxhighlight lang="wikitext">0</syntaxhighlight> 0
Default output
<syntaxhighlight lang="wikitext">yes</syntaxhighlight> yes <syntaxhighlight lang="wikitext"></syntaxhighlight>