Difference between revisions of "Template:If"

From Userful Support
Jump to navigationJump to search
 
m (Protected "Template:If" [edit=sysop:move=sysop])
 
(No difference)

Latest revision as of 19:58, 16 November 2006


Template: if -- performs if-then-else

Parameters:

  • 1 -- the condition to test (defined or undefined parameter, etc.)
  • then -- what to do if condition is true
  • else -- what to do if condition is false

Usage:

{{if|somecondition|then=dosomething|else=dosomethingelse}}
Note that you can skip then or else if you do not want to include it. Examples:
{{if|{{{username|}}}|then=Name is {{{username}}}|else=Who is this?}}
{{if|{{{username|}}}|else=Who is this?}}