Template:Ifndef

From Meta, a Wikimedia project coordination wiki
Jump to: navigation, search
[edit] [purge] Template documentation

This template provides branching without Extension:ParserFunctions for simple "if defined then void else do" statements with blank then part. It is the opposite of Template:Ifdef.

[edit] Usage

{{Ifndef|value|result}} yields result  if value  is blank.

It uses the code {{{2{{{1|}}}|}}}

See Template:Ifwpc for an overview of results, and comparisons.

[edit] Examples

Code Result
{{Ifndef|x|y}}
{{Ifndef||y}} y
{{Ifndef|2=y}} y
{{Ifndef|x}}
{{Ifndef|}}
{{Ifndef}}

[edit] Substitution

Convenient of the parameter default mechanism is that substitution works also, without any extra code.

The above documentation is transcluded from Template:Ifndef/doc. (edit | history)
Editors can experiment in this template's sandbox (create) and testcases (create) pages.
Please add categories and interwikis to the /doc subpage. Subpages of this template.
Personal tools
Namespaces

Variants
Actions
Navigation
Community
Beyond the Web
Toolbox