Vorlage:First-of

From FloraWiki - das Wiki zur Schweizer Flora
Revision as of 03:28, 20 January 2015 by Andreas Plank (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
[Bearbeiten] [Aktualisieren] Template-info.svg Dokumentation der Vorlage

This template takes up to four parameters, returning the first one that has any content. In contrast to default values of template parameters, this method is not sensitive to the difference between undefined (Null) and empty string.

Background

Normally, a template parameter evaluated with a default value, such as "{{{parameter1 | MISSING }}}" will return the default value ("Missing") if not appearing in the template call, but an empty string ("") if the template call contains:

| ...
| parameter1=
| ...

Usage

{{First-of| {{{primary|}}} | {{{alternative|}}} | DefaultValue }}
{{First-of|  | B | C }}
{{First-of|1=|2=B|3=C}}

Result in:

DefaultValue
B
B

See also

Related documentation on Wikipedia
https://wiki.infoflora.ch/swissflorawiki/d/index.php?title=Vorlage:First-of&oldid=302
wiki.infoflora.ch
crawl=CC-MAIN-2020-45
22552
application/http; msgtype=response
sha1:HHPBAYADVYUNZHC3EK63RZURA5MKLDIU
<urn:uuid:2497e5dc-cde0-4f28-bb5c-17939cfb82bd>
2020-10-21T11:05:24Z
141.101.61.67
text/html
sha1:W3WP6Q2JZ6I6YMH4D7GOHT53X7F34MEE
<urn:uuid:7d3d6b35-64e2-4706-87d1-d72e46dcc307>
https://wiki.infoflora.ch/swissflorawiki/d/index.php?title=Vorlage:First-of&oldid=302
response
<urn:uuid:a5499ca7-97af-4e3b-be09-c49e432e24f3>
isPartOf: CC-MAIN-2020-45
publisher: Common Crawl
description: Wide crawl of the web for October 2020
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-152.ec2.internal
software: Apache Nutch 1.17 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/