Difference between revisions of "Template:if"

m (Reverted edits by Wikiman232 (Talk); changed back to last version by TedErnst)
 
Line 1: Line 1:
{{{else{{{1|}}}|{{{3{{{1|}}}|{{{1{{{1|}}}|{{{then|{{{2|}}}}}}}}}}}}}}}<noinclude>
+
<noinclude>
==Usage==
+
Would be good to have some usage instructions here. Something like: '''<nowiki>{{</nowiki>if''' | "condition" | "what happens if condition is true" | "what happens if condition is false" '''}}''' 
Tests whether a value is defined.
 
  
<pre><nowiki>
+
An example of a template using "if" is [[Template:Badge:AsANetworkWeaverILiveIn]]
{{if|{{{Value|}}}
+
</noinclude>{{{else{{{1|}}}|{{{3{{{1|}}}|{{{1{{{1|}}}|{{{then|{{{2|}}}}}}}}}}}}}}}
|(Text to display if value is defined)
 
|(Text to display otherwise)
 
}}
 
 
 
OR
 
 
 
{{if|{{{Value|}}}
 
|then=(Text to display if value is defined)
 
|else=(Text to display otherwise)
 
}}
 
</nowiki></pre>
 
 
 
The third argument is optional.
 
 
 
[[Category:Utility_templates|{{PAGENAME}}]]</noinclude>
 

Latest revision as of 01:29, 6 October 2007

Would be good to have some usage instructions here. Something like: {{if | "condition" | "what happens if condition is true" | "what happens if condition is false" }}

An example of a template using "if" is Template:Badge:AsANetworkWeaverILiveIn