Acciones

Plantilla

Diferencia entre revisiones de «If both/doc»

De La Venciclopedia

m (Texto reemplazado: «Categoría:Venciclopedia:Indicaciones para el uso de plantillas» por «Categoría:Venciclopedia:Plantillas de uso»)
mSin resumen de edición
Línea 3: Línea 3:
__NOTOC____NOEDITSECTION__
__NOTOC____NOEDITSECTION__


This helper template is designed to be used in other templates. It can help editors create template code that is self-documenting.
Esta plantilla incluye un texto o código si dos parametros son verdaderos.


=== Usage ===
=== Uso ===
If '''a''' and '''b''' then true.
SI '''a''' y '''b''' entonces VERDADERO.


If '''a''' nor '''b''' then false.
SI '''a''' ni '''b''' entonces FALSO.


If '''a''' or '''b''' then false.
SI '''a''' o '''b''' entonces FALSO.


It can be used to replace the construct: <code><nowiki>{{#if:a|{{#if:b|true|false}}|false}}</nowiki></code>
Puede usarse para reemplazar el código: <code><nowiki>{{#if:a|{{#if:b|verdadero|falso}}|falso}}</nowiki></code>


=== Examples ===
=== Examples ===


<code><nowiki>{{if both| a | b |true|false}}</nowiki> → {{if both| a | b |true|false}}</code>
<code><nowiki>{{if both| a | b |verdadero|falso}}</nowiki> → {{if both| a | b |verdadero|falso}}</code>


<code><nowiki>{{if both| a | |true|false}}</nowiki> → {{if both| | b |true|false}}</code>
<code><nowiki>{{if both| a | |verdadero|falso}}</nowiki> → {{if both| | b |verdadero|falso}}</code>


<code><nowiki>{{if both| | b |true|false}}</nowiki> → {{if both| | b |true|false}}</code>
<code><nowiki>{{if both| | b |verdadero|falso}}</nowiki> → {{if both| | b |verdadero|falso}}</code>


<code><nowiki>{{if both| |  |true|false}}</nowiki> → {{if both| |  |true|false}}</code>
<code><nowiki>{{if both| |  |verdadero|falso}}</nowiki> → {{if both| |  |verdadero|falso}}</code>


=== Ver también ===
=== Ver también ===
Línea 28: Línea 28:
* {{tl|if empty}}
* {{tl|if empty}}
* {{tl|if all}}
* {{tl|if all}}
<includeonly>{{Sandbox other||
<includeonly>{{Sandbox other||
<!-- CATEGORIES GO HERE -->
<!-- CATEGORIES GO HERE -->
[[Categoría:Venciclopedia:Plantillas If-then-else|{{PAGENAME}}]]
[[Categoría:Venciclopedia:Plantillas If-then-else|{{PAGENAME}}]]
[[Categoría:Venciclopedia:Lista de plantillas|{{PAGENAME}}]]
<!-- INTERWIKIS GO HERE -->
<!-- INTERWIKIS GO HERE -->
}}</includeonly>
}}</includeonly>
<noinclude>[[Categoría:Venciclopedia:Plantillas de uso|{{PAGENAME}}]]</noinclude>
<noinclude>[[Categoría:Venciclopedia:Plantillas de uso|{{PAGENAME}}]]</noinclude>

Revisión del 01:12 30 sep 2020


Esta plantilla incluye un texto o código si dos parametros son verdaderos.

Uso

SI a y b entonces VERDADERO.

SI a ni b entonces FALSO.

SI a o b entonces FALSO.

Puede usarse para reemplazar el código: {{#if:a|{{#if:b|verdadero|falso}}|falso}}

Examples

{{if both| a | b |verdadero|falso}} → verdadero

{{if both| a | |verdadero|falso}} → falso

{{if both| | b |verdadero|falso}} → falso

{{if both| | |verdadero|falso}} → falso

Ver también