Patrono:Si non vacue
Description
Iste patrono restitue le prime parametro si illo non es vacue, alteremente illo restitue le secunde parametro. Isto es utile quando le prime parametro es un invocation de patrono o modulo que pote retornar un valor o nihil; es assecurate que le invocation se executa solmente un vice.
| Parametro | Description | Typo | Stato | |
|---|---|---|---|---|
| Valor a examinar | 1 | Valor restituite si non vacue. | Contento | suggerite |
| Valor si vacue | 2 | Le valor restituite si le prime parametro ha le valor vacue. | Contento | suggerite |
| Prefixo | 3 | Valor prefixate al valor del prime parametro si illo non es vacue. | Contento | optional |
| Suffixo | 4 | Valor suffixate al valor del prime parametro si illo non es vacue. | Contento | optional |
Pro compatibilitate con Wikipedia in anglese, iste patrono etiam ha le nomine {{If then show}}.
Exemplos
- conjuge (P26) for Richard Burton (Q151973)
{{Si non vacue|{{#invoke:WikidataIB|getValue|P26|qid=Q151973|fwd=ALL|osd=no}}|unmarried}}→ Elizabeth Taylor, Sybil Christopher, Suzy Miller, Elizabeth Taylor, Sally Burton
- conjuge (P26) for Franz Kafka (Q905)
{{Si non vacue|{{#invoke:WikidataIB|getValue|P26|qid=Q905|fwd=ALL|osd=no}}|unmarried}}→ unmarried
Prefixo e suffixo
Campo de quadro informative con microformato
A value in an infobox can be designed to be wrapped in a microformat if the wikidata call is not empty:
{{Si non vacue | {{#invoke:WikidataIB | getValue | rank=best |P19 |name=birth_place |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} | {{{birth_place|}}} }} || <span class="birthplace"> | </span>}}- If there is a local parameter supplied in the article (e.g.
|birth_place=London), the code will return<span class="birthplace">London</span>. - If there is no local parameter it will attempt to fetch a value for loco de nascentia (P19) from Wikidata.
- If that has a value, such as "New York", the code will return
<span class="birthplace">New York</span>. - If there is no value returned from Wikidata, the code returns nothing.
Tabella
A table can be designed to display a row only when a particular property of the article exists on Wikidata.
- conjuge (P26) for Richard Burton (Q151973)
{| class="wikitable" |- ! scope="col" style="width:15em;" | Label ! scope="col" style="width:36em;" | Value {{Si non vacue|{{#invoke:WikidataIB|getValue|P26|qid=Q151973|fwd=ALL|osd=no}}||<tr><th>{{#invoke:WikidataIB|getLabel|P26|qid=Q151973}}</th><td>|</td></tr>}} |}
- →
| Label | Value |
|---|---|
| conjuge | Elizabeth Taylor, Sybil Christopher, Suzy Miller, Elizabeth Taylor, Sally Burton |
- conjuge (P26) for Franz Kafka (Q905)
{| class="wikitable" |- ! scope="col" style="width:15em;" | Label ! scope="col" style="width:36em;" | Value {{Si non vacue|{{#invoke:WikidataIB|getValue|P26|qid=Q905|fwd=ALL|osd=no}}||<tr><th>{{#invoke:WikidataIB|getLabel|P26|qid=Q905}}</th><td>|</td></tr>}} |}
- →
| Label | Value |
|---|
Vide etiam
- Patrono:Si non equal
- tests whether the first unnamed parameter is equal to the second unnamed parameter and returns the third unnamed parameter if it does. Otherwise it returns the first unnamed parameter. This is useful when the first parameter is a
{{#invoke:of a Lua module that returns a value for which a specific exception is required. - Patrono:Si non vacue liga
- tests whether the first unnamed parameter is not an empty string and if it isn't, it returns the parameter formatted as piped wiki-link using an optional namespace prefix.
- Patrono:Formata ligamine
- takes an external identifier code as
|code=and uses a formatter url as|url=to construct a link to the external resource, which uses the code as display. - Patrono:Vacue o
- tests a piece of text to ascertain whether it's effectively empty or contains some text. If the unnamed parameter consists only of html tags, punctuation (e.g. Wiki-markup) and whitespace, then Emptyor returns nothing; otherwise it returns the parameter unchanged. Wrapper for p.emptyor function.


