Template:Ifimage

From Guild Wars Wiki 中文站
Jump to navigationJump to search

Description

{{ifimage|(filename)|(then)|(else)}}

This template is similar to {{#ifexist:}} + {{Ifexists}} as it checks the existence of the given file - this template however only works for files - not pages. The difference is that the checked file is not added to Wanted pages, and no hefty DPL is needed either. Instead, it uses the MediaWiki built-in function {{filepath:}}.

Parameters

unnamed parameter 1
File name without braces, including namespace.
unnamed parameter 2
Optional. Wikitext if page exists.
unnamed parameter 3
Optional. Wikitext if page does not exists.

Example

[[File:{{ifimage|Frenzy (black and white).jpg|Frenzy (black and white).jpg|Frenzy.jpg}}|20px]]

File:Frenzy.jpg

See also