Template:Ifdef
From Meta, a Wikimedia project coordination wiki
This template provides branching without Extension:ParserFunctions for simple "if defined then do" statements without else part. It is the opposite of Template:Ifndef.
See Template:Ifwpc for an overview of results, and comparisons.
[edit] Usage
{{ifdef|value|result}} yields result if value isn't blank.
It uses the code {{{1{{{1|}}}|{{{2|}}}}}}.
[edit] Examples
| Code | Result |
|---|---|
{{ifdef|x|y}} |
y |
{{ifdef||y}} |
|
{{ifdef|2=y}} |
y |
{{ifdef|x}} |
|
{{ifdef|}} |
|
{{ifdef}} |
[edit] Substitution
Convenient of the parameter default mechanism is that substitution works also, without any extra code.
| The above documentation is transcluded from Template:Ifdef/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. |