Template:Ifimage

From Guild Wars 2 Wiki
Jump to navigationJump to search

Description[edit]

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

Usage[edit]

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

Parameters[edit]

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

Example[edit]

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

Skill.png

See also[edit]