Jump to content

Template:Ifexist only Commons/doc

From Wikipedia, the free encyclopedia

Usage

[edit]

The {{ifexist only Commons}} template can be used to identify a media file which exists on Wikimedia Commons but not on English Wikipedia; whereas {{ifexist|File:...}} and {{ifexist|Media:...}} will only check, respectively, whether the file exists on English Wikipedia (the first) and on Commons or English Wikipedia (the second).

Use the format

{{ifexist only Commons|file name|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.

Examples

[edit]

File existing only on Commons

[edit]
{{Ifexist only Commons|Name.jpg|true|false}}

true

File existing only on English Wikipedia

[edit]
{{Ifexist only Commons|CemeteryGatesPantera.jpg|yes|no}}

no

File existing both on Commons and on English Wikipedia

[edit]
{{Ifexist only Commons|No Photo Available.svg|y|n}}

n

Non-existent file

[edit]
{{Ifexist only Commons|Non-existent filename.format|1|0}}

0