"ഫലകം:If empty/doc" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

imported>Jurema Oliveira
(ചെ.)No edit summary
misc
വരി 5:
This is the {{tl|ifempty}} template.
 
This template is used inside other templates. It takes up to nine parameters (parameters 1-9), and returns the first one that has any content. That is, the first one that is defined (notand null)non-empty, andotherwise not emptynothing. Typical usage is like this:
 
:<code><nowiki>{{ifempty| {{{logo|}}} | {{{image|}}} | default.svg }}</nowiki></code>
This returns the first of the parameters ''logo'' and ''image'' that is defined and non-empty, otherwise "default.svg".
 
=== Background ===
Line 43 ⟶ 44:
 
<tr><td><code><nowiki>{{ifempty|{{{1|}}}|{{{2|}}}|three}}</nowiki></code> <td>{{ifempty|{{{1|}}}|{{{2|}}}|three}} <td>
<tr><td><code><nowiki>{{ifempty|{{{1}}}|{{{2}}}|three}}</nowiki></code> <td>{{ifempty|{{{1}}}|{{{2}}}|three}} <td>FailsReturns the text "{{{1}}}", because it is a non-empty string. Note the lack of "|" in the first two parameters.
 
<tr><td><code><nowiki>{{ifempty|{{{logo|}}}|two}}</nowiki></code> <td>{{ifempty|{{{logo|}}}|two}} <td>
<tr><td><code><nowiki>{{ifempty|{{{logo}}}|two}}</nowiki></code> <td>{{ifempty|{{{logo}}}|two}} <td>FailsReturns the text "{{{logo}}}", because it is a non-empty string. Note the lack of "|" in the first parameter.
<tr><td><code><nowiki>{{ifempty|2=x}}</nowiki></code> <td>{{ifempty|2=x}} <td>Whether parameter 1 is undefined or empty does not matter.
 
<tr><td><code><nowiki>{{ifempty|p=q}}</nowiki></code> <td>{{ifempty|p=q}} <td>The template checks its parameters 1-9, not other ones.
</table>
 
"https://ml.wikipedia.org/wiki/ഫലകം:If_empty/doc" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്