Difference between revisions of "Template:If"
From Curious Expedition 2 Wiki
m  | 
				m  | 
				||
| Line 3: | Line 3: | ||
See [https://meta.wikimedia.org/wiki/Help:Advanced_templates#Branching_techniques_without_ParserFunctions WikiMedia Help - Advanced Templates - Branching techniques without ParserFunctions].  | See [https://meta.wikimedia.org/wiki/Help:Advanced_templates#Branching_techniques_without_ParserFunctions WikiMedia Help - Advanced Templates - Branching techniques without ParserFunctions].  | ||
| + | |||
| + | {{examples}}  | ||
| + | |-  | ||
| + | {{example3|if|defined|Argument is non-empty}}  | ||
| + | |-  | ||
| + | {{example3|if||Argument is non-empty}}  | ||
| + | |}  | ||
[[Category:Text templates]]  | [[Category:Text templates]]  | ||
Revision as of 19:40, 10 January 2021
Returns the second argument if the first argument is non-empty; returns empty otherwise.
See WikiMedia Help - Advanced Templates - Branching techniques without ParserFunctions.
Examples
| You type | You get{{{1}}} | 
|---|
|-
|-
|
{{if|defined|Argument is non-empty}}
|
Argument is non-empty
|-
|-
|
{{if||Argument is non-empty}}
|
|}