Jump to content
Wikipedia The Free Encyclopedia

Template:Ifexist only Commons

From Wikipedia, the free encyclopedia
Template documentation[view] [edit] [history] [purge]

Usage

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:...}} 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

File existing only on Commons

{{Ifexist only Commons|Name.jpg|true|false}}

true

File existing only on English Wikipedia

{{Ifexist only Commons|CemeteryGatesPantera.jpg|yes|no}}

no

File existing both on Commons and on English Wikipedia

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

n

Non-existent file

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

0

The above documentation is transcluded from Template:Ifexist only Commons/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.

AltStyle によって変換されたページ (->オリジナル) /