Difference between revisions of "Template:Ifexist not redirect/doc"

From blackwiki
Jump to navigation Jump to search
imported>Dresken
(Clarified output examples)
imported>Wbm1058
(updated transclusion count)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 +
{{high-risk|3690000+ pages, which is ≈{{#expr:(369354600/{{NUMBEROFPAGES:R}}) round 0}}% of all}}
 +
 
== Usage ==
 
== Usage ==
 
The '''<nowiki>{{</nowiki>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.
 
The '''<nowiki>{{</nowiki>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.

Revision as of 00:41, 19 October 2016

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 serials):

  • {{Ifexist not redirect|List of Doctor Who serials|true|false}}: false
  • {{#ifexist:List of Doctor Who serials|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-existant 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 serials}}:
  • {{Ifexist not redirect|List of Daredevil episodes}}: