Difference between revisions of "Template:Temp test"
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly>{| border=0 style="max-width: 190px; text-align: center" | <includeonly>{| border=0 style="max-width: 190px; text-align: center" | ||
− | + | {{#if: {{{var_x1|var_x2|var_x3|}}} | <tr style="color: white; background: #4b4d4f; text-align: center;"><td> {{{var_x1}}}{{{var_x2}}}{{{var_x3}}}</td></tr> | <tr height="0">Nothing was passed!</tr>}} | |
− | |||
− | |||
− | {{#if: {{{var_x1|var_x2|var_x3|}}} | <tr style="color: white; background: #4b4d4f; text-align: center; | ||
|}</includeonly> | |}</includeonly> | ||
<noinclude>[[Category:Templates|{{PAGENAME}}]] | <noinclude>[[Category:Templates|{{PAGENAME}}]] | ||
Line 12: | Line 9: | ||
|} | |} | ||
<div style="clear: both;"></div> | <div style="clear: both;"></div> | ||
− | {| class="wikitable | + | {| class="wikitable" |
|+When none are passed in: | |+When none are passed in: | ||
| valign="top" |{{Temp_test|var_x1=|var_x2=|var_x3=}}<br> | | valign="top" |{{Temp_test|var_x1=|var_x2=|var_x3=}}<br> | ||
|} | |} | ||
− | {| class="wikitable | + | {| class="wikitable" |
|+When any are passed in: | |+When any are passed in: | ||
− | | valign="top" |{{Temp_test|var_x1=Yes|var_x2=|var_x3=}}<br> | + | | valign="top" |{{Temp_test|var_x1=Yes|var_x2=Yes|var_x3=}}<br> |
|} | |} | ||
+ | <div> | ||
+ | The main factor here is the pipe within the if statement testing beyond what variable is resolved: | ||
+ | <pre>{{#if: {{{var_x1|var_x2|var_x3|}}} | Something was Passed | Nothing was passed!}}</pre> | ||
+ | </div> | ||
</noinclude> | </noinclude> |
Latest revision as of 04:17, 15 September 2021
Use/Examples
When passing variables.
{{Temp_test|var_x1=|var_x2=|var_x3=}} |
Nothing was passed!
|
|
The main factor here is the pipe within the if statement testing beyond what variable is resolved:
{{#if: {{{var_x1|var_x2|var_x3|}}} | Something was Passed | Nothing was passed!}}