Mudanças entre as edições de "Predefinição:If"

De Sala Virtual Brusque
Ir para navegaçãoIr para pesquisar
(Criou página com '{{{else{{{test|}}}|{{{else{{{test|}}}|{{{test{{{test|}}}|{{{then|}}}}}}}}}}}}<noinclude> i </noinclude>')
 
 
Linha 1: Linha 1:
{{{else{{{test|}}}|{{{else{{{test|}}}|{{{test{{{test|}}}|{{{then|}}}}}}}}}}}}<noinclude>
+
{{{{{subst|}}}p{{{{{subst|}}}#ifeq:{{{1}}}|eq|1|2}}|{{{{{subst|}}}p{{{{{subst|}}}#ifeq:{{{2}}}|{{{3}}}|1|2}}|{{{4|}}}|{{{5|}}}}}|{{{{{subst|}}}p{{{{{subst|}}}#if{{{1}}}:{{{2}}}|1|2}}|{{{3}}}|{{{4|}}}}}}}<noinclude>{{documentation}}</noinclude>
[[Categoria:!Predefinições para o domínio predefinição|i]]
 
</noinclude>
 

Edição atual tal como às 15h31min de 27 de fevereiro de 2012

Predefinição:P2

[editar] [⧼code-rev-purge-link⧽] 50px Template documentation

Predefinição:Documentation subpagePredefinição:Pp-template

With this template the parser functions of the ParserFunctions collection with names starting with "#if" can be used in a way such that they do not strip spaces and newlines from the "then" and "else" part. Spaces still do not affect the outcome of the condition.

Usage

Compare:

  • {{#if:x| p | q }} gives "p"
  • {{#ifexpr:2<3| p | q }} gives "p"
  • {{#ifeq: u |u| p | q }} gives "p"
  • {{#ifexist: Help:Link | p | q }} gives "q"
  • {{#iferror:{{#expr:x}}| p | q }} gives "p"

For full substitution, use e.g. {{subst:if|expr|2<3| p | q |subst=subst:}}. If the condition contains a parser function or template etc., that should be substituted too. Optionally the "then" or "else" part can also be substituted.

See also

  • m:Template:If
  • Template:Ifnotempty - for simplicity and to reduce the limitations due to the expansion depth limit, this is a separate template corresponding to #if only.

ru:Template:If es:Plantilla:If fr:Modèle:If nso:Template:If

The above documentation is transcluded from Predefinição:If/doc. (edit | history)
Editors can experiment in this template's sandbox (create) and testcases (create) pages.
Please add categories and interwikis to the /doc subpage. Subpages of this template.