Template:Ifndef

From Sumo
Jump to navigation Jump to search

Description

{{Ifndef|{{{p}}}|then}}

Allows conditional code for optional parameters. If the parameter p is undefined, the string then is inserted. The template is the opposite of Template:Ifdef. It is necessary, because the MediaWiki of Sourceforge here has not got the extended parser function like #if:. For further details, look at the Wikipedia pages Template:Ifndef and Help:Advanced templates#Branching techniques without ParserFunctions.

Example

{{ifndef|{{{url}}}|
{{!}}-
{{!}} colspan{{=}}"2" {{!}} Please help to find a URL }}

If the parameter url is defined, the code results in nothing. If it is undefined,

|-
| colspan="2" | Please help to find a URL

is inserted.