Template:IfAND: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(Adding custom return handling) |
||
Line 2: | Line 2: | ||
==Use== |
==Use== |
||
This template will accept 10 variable names and return 1 if they all exist and nothing if any one of them is nonexistant or whitespace. |
This template will accept 10 variable names and return 1 if they all exist and nothing if any one of them is nonexistant or whitespace. |
||
If <nowiki>|true=</nowiki> or <nowiki>|false=</nowiki> is set, it will return custom strings for matches or no matches. |
|||
[[Category:Templates|{{PAGENAME}}]] |
[[Category:Templates|{{PAGENAME}}]] |
||
[[Category:Templates for Templates|{{PAGENAME}}]] |
[[Category:Templates for Templates|{{PAGENAME}}]] |
||
<pre> |
<pre> |
||
{{IfAND|variable1|...|variable10}} |
{{IfAND|variable1|...|variable10}} |
||
Additional options: |
|||
|true= |
|||
|fals= |
|||
</pre> |
</pre> |
||
</noinclude> |
</noinclude> |
||
<includeonly>{{#switch:{{#If:{{{1}}}|{{{1|undefined}}}|empty}}|empty=|undefined=1|<!--defined-->{{#switch:{{#If:{{{2}}}|{{{2|undefined}}}|empty}}|empty=|undefined=1|<!--defined-->{{#switch:{{#If:{{{3}}}|{{{3|undefined}}}|empty}}|empty=|undefined=1|<!--defined-->{{#switch:{{#If:{{{4}}}|{{{4|undefined}}}|empty}}|empty=|undefined=1|<!--defined-->{{#switch:{{#If:{{{5}}}|{{{5|undefined}}}|empty}}|empty=|undefined=1|<!--defined-->{{#switch:{{#If:{{{6}}}|{{{6|undefined}}}|empty}}|empty=|undefined=1|<!--defined-->{{#switch:{{#If:{{{7}}}|{{{7|undefined}}}|empty}}|empty=|undefined=1|<!--defined-->{{#switch:{{#If:{{{8}}}|{{{8|undefined}}}|empty}}|empty=|undefined=1|<!--defined-->{{#switch:{{#If:{{{9}}}|{{{9|undefined}}}|empty}}|empty=|undefined=1|<!--defined-->{{#switch:{{#If:{{{10}}}|{{{10|undefined}}}|empty}}|empty=|undefined=1|1}}}}}}}}}}}}}}}}}}}}</includeonly> |
<includeonly>{{#switch:{{#If:{{{1}}}|{{{1|undefined}}}|empty}}|empty={{#If:{{{false|}}}|{{{false}}}}}|undefined={{#If:{{{true}}}|{{#If:{{{true|}}}|{{{true}}}|1}}}}|<!--defined-->{{#switch:{{#If:{{{2}}}|{{{2|undefined}}}|empty}}|empty={{#If:{{{false|}}}|{{{false}}}}}{{#If:{{{false|}}}|{{{false}}}}}|undefined={{#If:{{{true}}}|{{#If:{{{true|}}}|{{{true}}}|1}}}}|<!--defined-->{{#switch:{{#If:{{{3}}}|{{{3|undefined}}}|empty}}|empty={{#If:{{{false|}}}|{{{false}}}}}|undefined={{#If:{{{true}}}|{{#If:{{{true|}}}|{{{true}}}|1}}}}|<!--defined-->{{#switch:{{#If:{{{4}}}|{{{4|undefined}}}|empty}}|empty={{#If:{{{false|}}}|{{{false}}}}}|undefined={{#If:{{{true}}}|{{#If:{{{true|}}}|{{{true}}}|1}}}}|<!--defined-->{{#switch:{{#If:{{{5}}}|{{{5|undefined}}}|empty}}|empty={{#If:{{{false|}}}|{{{false}}}}}|undefined={{#If:{{{true}}}|{{#If:{{{true|}}}|{{{true}}}|1}}}}|<!--defined-->{{#switch:{{#If:{{{6}}}|{{{6|undefined}}}|empty}}|empty={{#If:{{{false|}}}|{{{false}}}}}|undefined={{#If:{{{true}}}|{{#If:{{{true|}}}|{{{true}}}|1}}}}|<!--defined-->{{#switch:{{#If:{{{7}}}|{{{7|undefined}}}|empty}}|empty={{#If:{{{false|}}}|{{{false}}}}}|undefined={{#If:{{{true}}}|{{#If:{{{true|}}}|{{{true}}}|1}}}}|<!--defined-->{{#switch:{{#If:{{{8}}}|{{{8|undefined}}}|empty}}|empty={{#If:{{{false|}}}|{{{false}}}}}|undefined={{#If:{{{true}}}|{{#If:{{{true|}}}|{{{true}}}|1}}}}|<!--defined-->{{#switch:{{#If:{{{9}}}|{{{9|undefined}}}|empty}}|empty={{#If:{{{false|}}}|{{{false}}}}}|undefined={{#If:{{{true}}}|{{#If:{{{true|}}}|{{{true}}}|1}}}}|<!--defined-->{{#switch:{{#If:{{{10}}}|{{{10|undefined}}}|empty}}|empty={{#If:{{{false|}}}|{{{false}}}}}|undefined={{#If:{{{true}}}|{{#If:{{{true|}}}|{{{true}}}|1}}}}|1}}}}}}}}}}}}}}}}}}}}</includeonly> |
Revision as of 14:11, 22 April 2008
Use
This template will accept 10 variable names and return 1 if they all exist and nothing if any one of them is nonexistant or whitespace.
If |true= or |false= is set, it will return custom strings for matches or no matches.
{{IfAND|variable1|...|variable10}} Additional options: |true= |fals=