साँचा:If either/doc
{{
साँचा:namespace detect
| type = notice
| image =
| imageright =
| class =
| style = margin-bottom:1.0em;
| textstyle =
| text = साँचा:strong for साँचा:terminate sentence
It contains usage information, categories and other content that is not part of the original साँचा page.
| small =
| smallimage =
| smallimageright =
| smalltext =
| subst =
| date =
| name =
}}
{{if either (|a) (|b) (|first result) (|second result)}}
- "If either (a or) (b) is true, (return first result,) (else return second result)."
This helper template is designed to be used in other templates. It can help editors create template code that or self documenting. The major advantage of using this template over using the construct साँचा:nowrap is that if the first parameter is not empty then the second parameter is not evaluated.
The "or" in the "a or b" above is inclusive: if both a and b are true, the template will return the first result.
This template can also be used to replace the construct साँचा:nowrap (i.e. "if a, then true; else if b, then true; else false").
Examples
Code | Result |
---|---|
{{if either |a |b |true |false}} | साँचा:if either |
{{if either |a | |true |false}} | साँचा:if either |
{{if either | |b |true |false}} | साँचा:if either |
{{if either | | |true |false}} | साँचा:if either |
See also