Difference between revisions of "Template:If"
From Curious Expedition 2 Wiki
m |
m |
||
| Line 1: | Line 1: | ||
<includeonly>{{{1{{{1|}}}|{{{2}}}}}}<nowiki/></includeonly><noinclude> | <includeonly>{{{1{{{1|}}}|{{{2}}}}}}<nowiki/></includeonly><noinclude> | ||
| + | Returns second argument if first argument is defined, empty otherwise. | ||
See [https://meta.wikimedia.org/wiki/Help:Advanced_templates#Branching_techniques_without_ParserFunctions MediaWiki Help - Advanced Templates - Branching techniques without ParserFunctions]. | See [https://meta.wikimedia.org/wiki/Help:Advanced_templates#Branching_techniques_without_ParserFunctions MediaWiki Help - Advanced Templates - Branching techniques without ParserFunctions]. | ||
| − | [[Category: | + | {{examples}} |
| + | |- | ||
| + | {{example3|if|defined|Argument defined!}} | ||
| + | |- | ||
| + | {{example3|if||Argument defined!}} | ||
| + | |} | ||
| + | |||
| + | [[Category:Text templates]] | ||
Revision as of 09:41, 10 January 2021
Returns second argument if first argument is defined, empty otherwise.
See MediaWiki Help - Advanced Templates - Branching techniques without ParserFunctions.
Examples
| You type | You get{{{1}}} |
|---|
|-
|-
|
{{if|defined|Argument defined!}}
|
Argument defined!
|-
|-
|
{{if||Argument defined!}}
|
|}