Difference between revisions of "Template:If both/doc"

From blackwiki
Jump to navigation Jump to search
imported>Droll
(tweak text)
imported>Droll
(tidied up)
Line 2: Line 2:
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
__NOTOC__
 
__NOTOC__
 +
===Purpose===
 
This simple template is designed to facilitate template coding and should only be used in templates.
 
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'''.
  
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''.
  
I both a and b are true {defined} then a is defined
+
If either ''a'' or ''b'' are undefined then the template resolves to ''y'.
If either a or be are (undefined) then is b defined
 
  
 
<nowiki>{{if a | b | x | y}} --> x</nowiki>
 
<nowiki>{{if a | b | x | y}} --> x</nowiki>
Line 13: Line 15:
 
<nowiki>{{if a | &ensp;  | x | y}} --> y</nowiki>
 
<nowiki>{{if a | &ensp;  | x | y}} --> y</nowiki>
  
 +
 +
===See also===
 +
*{{tl|ifempty}}
 
<noinclude>
 
<noinclude>
 
<!-- PLEASE ADD CATEGORIES AND  
 
<!-- PLEASE ADD CATEGORIES AND  

Revision as of 18:28, 9 February 2010

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'.

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

{{if a |   | x | y}} --> y


See also