Difference between revisions of "Template:Firstdata/doc"

From blackwiki
Jump to navigation Jump to search
imported>DePiep
imported>DePiep
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 +
In template code, one can list multiple input parameters, and this template will return the first input value that is not blank.
 +
 
== Usage ==
 
== Usage ==
 
Can have up to five parameters input. Will return the first parameter that is not blank.
 
Can have up to five parameters input. Will return the first parameter that is not blank.

Revision as of 13:07, 3 October 2019

In template code, one can list multiple input parameters, and this template will return the first input value that is not blank.

Usage

Can have up to five parameters input. Will return the first parameter that is not blank.

{{firstdata
|1=
|2=
|3=
|4=
|5=
}}

or

{{firstdata|||}}

Practical use is inside an other template:

{{firstdata|{{{foo|}}} |{{{bar|}}} }}

Whitespace is stripped.

example

  • {{firstdata||two|three}} → two
  • {{firstdata|one||three}} → one
  • {{firstdata|||}} →