Difference between revisions of "Template:If both/doc"
Jump to navigation
Jump to search
imported>Droll (added category) |
imported>Droll (tweak) |
||
Line 7: | Line 7: | ||
== Usage == | == Usage == | ||
− | If '''a''' and '''b''' then | + | If '''a''' and '''b''' then true. |
− | If '''a''' nor '''b''' then | + | If '''a''' nor '''b''' then false. |
− | If '''a''' or '''b''' then | + | If '''a''' or '''b''' then false. |
− | It can be used to replace the construct: <tt><nowiki>{{#if: a | {{#if: b | | + | It can be used to replace the construct: <tt><nowiki>{{#if:a|{{#if:b|true|false}}</nowiki></tt> |
== Examples == | == Examples == | ||
+ | <tt> | ||
+ | <nowiki>{{if both| a | b |true|false}}</nowiki> → {{if both| a | b |true|false}} | ||
− | + | <nowiki>{{if both| a | |true|false}}</nowiki> → {{if both| | b |true|false}} | |
− | + | <nowiki>{{if both| | b |true|false}}</nowiki> → {{if both| | b |true|false}} | |
+ | <tt> | ||
− | + | Note that : | |
+ | <nowiki>{{if both| {{sp}} | b |true|false}}</nowiki> → {{if both| {{sp}} | b |true|false}} | ||
== See also == | == See also == | ||
Line 30: | Line 34: | ||
<noinclude> | <noinclude> | ||
<!-- CATEGORIES GO HERE --> | <!-- CATEGORIES GO HERE --> | ||
− | Category:If-then-else templates | + | [[Category:If-then-else templates]] |
<!-- INTERWIKIS GO HERE --> | <!-- INTERWIKIS GO HERE --> | ||
</noinclude> | </noinclude> |
Revision as of 18:33, 12 October 2010
![]() | This is a documentation subpage for Template:If both. It contains usage information, categories and other content that is not part of the original template page. |
This helper template is designed to be used in other templates. It can help editors create templates that or self documenting.
Usage
If a and b then true.
If a nor b then false.
If a or b then false.
It can be used to replace the construct: {{#if:a|{{#if:b|true|false}}
Examples
{{if both| a | b |true|false}} → true
{{if both| a | |true|false}} → false
{{if both| | b |true|false}} → false
Note that : {{if both| {{sp}} | b |true|false}} → true
See also