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

39 ബൈറ്റുകൾ കൂട്ടിച്ചേർത്തിരിക്കുന്നു ,  8 വർഷം മുമ്പ്
updates following move
(update, {{high-use| 381,000+ }})
imported>Sardanaphalus
(updates following move)
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
This is the {{tl|ifemptyif empty}} template.
 
This template is used inside other templates. It takes up to nine parameters (parameters 1-9), and returns the first one that is defined and non-empty, otherwise nothing. Typical usage is like this:
 
:<code><nowiki>{{ifemptyif empty| {{{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".
 
Then it is easier to use this template instead:
 
:<code><nowiki>{{ifemptyif empty| {{{logo|}}} | {{{image|}}} | default.svg }}</nowiki></code>
 
'''Note!''' The parameters to {{tlf|ifemptyif empty}} must use the pipe "|", like this: <code><nowiki>{{{logo|}}}</nowiki></code>. Or else {{tlf|ifemptyif empty}} will be fed and return the string "<code><nowiki>{{{logo}}}</nowiki></code>" if ''logo'' was not defined.
 
=== Examples ===
<table class="wikitable">
<tr><th>Code<th>Result<th>Comment
<tr><td>{{tlc|ifemptyif empty}} <td>{{ifemptyif empty}} <td>Returns an empty string.
<tr><td>{{tlc|ifemptyif empty|one}} <td>{{ifemptyif empty|one}} <td>Returns the first parameter that is defined and not empty.
<tr><td>{{tlc|ifemptyif empty|one|two}} <td>{{ifemptyif empty|one|two}} <td>
<tr><td>{{tlc|ifemptyif empty|one|two|three|four}} <td>{{ifemptyif empty|one|two|three|four}} <td>
<tr><td>{{tlc|ifemptyif empty||two}} <td>{{ifemptyif empty||two}} <td>The first parameter was empty or undefined, so uses the next parameter.
<tr><td>{{tlc|ifemptyif empty||two|three|four}} <td>{{ifemptyif empty||two|three|four}} <td>
<tr><td>{{tlc|ifemptyif empty||two||four}} <td>{{ifemptyif empty||two||four}} <td>
<tr><td><code><nowiki>{{ifemptyif empty|||||||||nine}}</nowiki></code> <td>{{ifemptyif empty|||||||||nine}} <td>
<tr><td><code><nowiki>{{ifemptyif empty||||||||||ten}}</nowiki></code> <td>{{ifemptyif empty||||||||||ten}} <td>Only handles up to nine parameters, so returns an empty string.
<tr><td>{{tlc|ifemptyif empty|}} <td>{{ifemptyif empty|}} <td>The only parameter is empty or undefined, so returns an empty string.
<tr><td>{{tlc|ifemptyif empty||||}} <td>{{ifemptyif empty||||}} <td>Returns an empty string.
 
<tr><td><code><nowiki>{{ifemptyif empty|{{{1|}}}|{{{2|}}}|three}}</nowiki></code> <td>{{ifemptyif empty|{{{1|}}}|{{{2|}}}|three}} <td>
<tr><td><code><nowiki>{{ifemptyif empty|{{{1}}}|{{{2}}}|three}}</nowiki></code> <td>{{ifemptyif empty|{{{1}}}|{{{2}}}|three}} <td>Returns the text "{{{1}}}", because it is a non-empty string. Note the lack of "|" in the first two parameters.
 
<tr><td><code><nowiki>{{ifemptyif empty|{{{logo|}}}|two}}</nowiki></code> <td>{{ifemptyif empty|{{{logo|}}}|two}} <td>
<tr><td><code><nowiki>{{ifemptyif empty|{{{logo}}}|two}}</nowiki></code> <td>{{ifemptyif empty|{{{logo}}}|two}} <td>Returns the text "{{{logo}}}", because it is a non-empty string. Note the lack of "|" in the first parameter.
<tr><td><code><nowiki>{{ifemptyif empty|2=x}}</nowiki></code> <td>{{ifemptyif empty|2=x}} <td>Whether parameter 1 is undefined or empty does not matter.
<tr><td><code><nowiki>{{ifemptyif empty|p=q}}</nowiki></code> <td>{{ifemptyif empty|p=q}} <td>The template checks its parameters 1-9, not other ones.
</table>
 
അജ്ഞാത ഉപയോക്താവ്
"https://ml.wikipedia.org/wiki/പ്രത്യേകം:മൊബൈൽവ്യത്യാസം/2124620" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്