Template:If

From Userful Support
Revision as of 19:58, 16 November 2006 by Menwin (Retired) (talk | contribs) (Protected "Template:If" [edit=sysop:move=sysop])
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


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?}}