Are if/then statements enabled for use in templates in the latest version of MediaWiki, as they are in Wikipedia?
You'll need the Parser Function: http://meta.wikimedia.org/wiki/ParserFunctions or http://www.mediawiki.org/wiki/Extension:Parser_function_extensions (not sure which one's more recent/accurate)
HTH.
-- F.