Template:Ifexist only Commons/doc
Appearance
This is a documentation subpage for Template:Ifexist only Commons. It may contain usage information, categories and other content that is not part of the original template page. |
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]- Local: File:Name.jpg
- Commons: commons:File:Name.jpg
{{Ifexist only Commons|Name.jpg|true|false}}
true
File existing only on English Wikipedia
[edit]- Local: File:CemeteryGatesPantera.jpg
- Commons: commons:File:CemeteryGatesPantera.jpg
{{Ifexist only Commons|CemeteryGatesPantera.jpg|yes|no}}
no
File existing both on Commons and on English Wikipedia
[edit]- Local: File:No Photo Available.svg
- Commons: commons:File:No Photo Available.svg
{{Ifexist only Commons|No Photo Available.svg|y|n}}
n
Non-existent file
[edit]{{Ifexist only Commons|Non-existent filename.format|1|0}}
0