Template:If both/doc

From blackwiki
< Template:If both
Revision as of 20:45, 31 July 2010 by imported>Droll (moved Template:If2/doc to Template:If both/doc)
Jump to navigation Jump to search

Purpose

This simple template is designed to facilitate template coding and should only be used in templates.

Function

The functionality is simple. If a and b then x else y.

I both a and b are defined then the template resolves to x.

If either a or b are undefined then the template resolves to y.

{{if2 | a | b | x | y}} --> x
{{if2 | a |   | x | y}} --> y

It can be used to replace the construct:

{{#if: a | {{#if: b | x | y }}}}


See also