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

Undid revision 740872154 by 24.107.145.1 (talk) Sorry! My bad!
links
വരി 1:
{{Documentation subpage}}
{{Template redirectsredirect |Ifempty |First nonempty |Use first nonempty}}
{{Lua|Module:If empty}}
{{High-risk | 640000+ }}
വരി 28:
 
====Piping====
Parameters used with {{tlf|if empty}} must be [[Pipe (Unix)|pipe]]d&nbsp;– i.e. include the [[Vertical bar|vertical bar (pipe) symbol]] {{nowrap|("{{thinspthin space}}&#124;{{thinspthin space}}")}} as a trailing character&nbsp;– so that empty or undefined parameters aren't treated as text and returned incorrectly. Hence, for example, <code><nowiki>{{{logo|}}}</nowiki></code>, <code><nowiki>{{{image|}}}</nowiki></code> and <code><nowiki>{{{picture|}}}</nowiki></code> rather than {{param|logo}}, {{param|image}} and {{param|picture}} in the above examples.
 
===Examples===
വരി 35:
|row1style=background:whitesmoke;padding-left:0.5em;font-weight:bold;
| Code | Result |
| {{tctlc|if empty}} | {{if empty}} | Returns an empty string.
| {{tctlc|if empty|one}} | {{if empty|one}} | Returns the first parameter that is defined and not empty.
| {{tctlc|if empty|one|two}} | {{if empty|one|two}} |
| {{tctlc|if empty|one|two|three|four}} | {{if empty|one|two|three|four}} |
| {{tctlc|if empty||two}} | {{if empty||two}} | The first parameter is empty/undefined, so is passed over.
| {{tctlc|if empty||two|three|four}} | {{if empty||two|three|four}} |
| {{tctlc|if empty||two||four}} | {{if empty||two||four}} |
| <code><nowiki>{{if empty||||||||||ten}}</nowiki></code> | {{if empty||||||||||ten}} | Unlike in previous versions, this template is no longer limited by 9 parameters.
| {{tctlc|if empty|}} | {{if empty|}} | The only parameter is empty or undefined, so returns an empty string.
| {{tctlc|if empty||||}} | {{if empty||||}} | Returns an empty string.
| <code><nowiki>{{if empty|{{{1|}}}|{{{2|}}}|three}}</nowiki></code> | {{if empty|{{{1|}}}|{{{2|}}}|three}} |
| <code><nowiki>{{if empty|{{{1}}}|{{{2}}}|three}}</nowiki></code> | {{if empty|{{{1}}}|{{{2}}}|three}} | No pipe-characters following the names of the first two parameters ("1" and "2"), so the first of these returned as text ("{{{1}}}").
"https://ml.wikipedia.org/wiki/ഫലകം:If_empty/doc" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്