Pojdi na vsebino

Predloga:Ifempty/testniprimeri

Iz Wikipedije, proste enciklopedije

one should be one; nine should be nine —CodeHydro 18:43, 23 December 2014 (UTC)

Code Sandbox Current
{{Ifempty/peskovnik}} Returns an empty string.
{{Ifempty/peskovnik|one}} one one Returns the first parameter that is defined and not empty.
{{Ifempty/peskovnik|one|two}} one one
{{Ifempty/peskovnik|one|two|three|four}} one one
{{Ifempty/peskovnik|two}} two two The first parameter is empty/undefined, so is passed over.
{{Ifempty/peskovnik|two|three|four}} two two
{{Ifempty/peskovnik|two|four}} two two
{{Ifempty/peskovnik|||||||||nine}} nine nine
{{Ifempty/peskovnik||||||||||ten}} ten ten Empty string returned if maximum of nine parameters exceeded.
{{Ifempty/peskovnik}} The only parameter is empty or undefined, so returns an empty string.
{{Ifempty/peskovnik}} Returns an empty string.
{{Ifempty/peskovnik|{{{1|}}}|{{{2|}}}|three}} three three
{{Ifempty/peskovnik|{{{1}}}|{{{2}}}|three}} {{{1}}} {{{1}}} No pipe-characters following the names of the first two parameters ("1" and "2"), so the first of these returned as text ("{{{1}}}").
{{Ifempty/peskovnik|{{{logo|}}}|two}} two two
{{Ifempty/peskovnik|{{{logo}}}|two}} {{{logo}}} {{{logo}}} No pipe-character following the parameter name "logo", so the text "{{{logo}}}" returned.
{{Ifempty/peskovnik|2=x}} x x Whether parameter 1 is undefined or empty does not matter.
{{Ifempty/peskovnik|p=q}} The template identifies the parameters it receives as parameters 1 to 9, not using names such as "p", etc.
{{Ifempty/peskovnik|one|{{X1}}[[Kategorija:X1]]}} one one Parameters after the first non-empty parameter are not expanded, so this page does not transclude Template:X1 and is not in Kategorija:X1.