Template:Ifdef/doc

Documentation
is a compact variant of Qif for simple "if defined then do" statements without else part. It's the opposite of ifndef.

Usage
yields result&#160; if value&#160; isn't blank.

This template is used to simplify the following equivalent but somewhat cryptic code variants:



Example
''See also a simpler example using ifdef. There's no default in ifdef for the second parameter, because this could hide problematic code.''

Caveats
In templates the characters "=" (&amp;#61;) and "|" (&amp;#124;) cannot be used as is in parameters. The numeric character references &amp;#61; and &amp;#124; are often good enough, but for Wiki and XHTML markup the literal characters are required:
 * 1) For | template:! ( edit•talk•links•history ) offers a workaround.
 * 2) For = the template parameter mechanism allows 1 resulting in "" instead of 1 resulting in "".

Substitution works only for ifdef, but not for ifndef or qif.

Source
Copied from the page on meta where it is released under the GFDL.