Difference between revisions of "Template:Firstdata/doc"

From blackwiki
Jump to navigation Jump to search
imported>DePiep
imported>DePiep
Line 17: Line 17:
 
<pre>{{firstdata|{{{foo|}}} |{{{bar|}}} }}</pre>
 
<pre>{{firstdata|{{{foo|}}} |{{{bar|}}} }}</pre>
  
 +
Whitespace is stripped.
 
==example==
 
==example==
 
* <nowiki>{{firstdata||two|three}}</nowiki> &rarr; {{firstdata||two|three}}
 
* <nowiki>{{firstdata||two|three}}</nowiki> &rarr; {{firstdata||two|three}}
Line 25: Line 26:
 
<includeonly>{{sandbox other||
 
<includeonly>{{sandbox other||
 
<!-- Categories below this line, please; interwikis at Wikidata -->
 
<!-- Categories below this line, please; interwikis at Wikidata -->
[[category:if templates]]
+
[[category:Parameter selection templates]]
 
}}</includeonly>
 
}}</includeonly>

Revision as of 10:15, 13 December 2016

Usage

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

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

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|||}} →