Template:Concat

From Meta, a Wikimedia project coordination wiki
Jump to: navigation, search
[edit] [purge] Template documentation

Contents

[edit] Wikitext

This Template:Concat contains:


{{{1|}}}{{{2|}}}{{{3|}}}...{{{150|}}}


[edit] Purpose

This template concatenates parameters 1 − 150, as far as defined.

Newlines and spaces are preserved in the "expansion", and rendered as usual.

[edit] Usage

{{Concat
  |data
  |data
  |...
}}

or

{{Concat
  |number=data
  |number=data
  |...
}}

The first form is not useful to apply directly; it can be useful in another template, e.g. Template:For. The second form sorts the data by parameter number, and removes duplicates: only the lastly defined value of a parameter counts; however, a defined value cannot be made undefined by any code later in the template call.

[edit] Examples

Code Result
{{Concat|}}
{{Concat|a}} a
"{{Concat| a |b |c| d

}}"

" a b c d

"

{{Concat|a|b|c}} abc
{{Concat|2=a|3=b|1=c}} cab
{{Concat|2=a|3=b|2=c}} cb
{{Concat|100=a|200=b}} ab
{{Concat|1=2=3|4=5=6}} 2=35=6
{{for|, |call=concat and link to w:en:|pcv1=John_|pv=2||Lennon|Wayne}} John_, John_Lennon, John_Wayne

The last example uses Template:concat and link to w:en: containing "[[w:en:{{{1|}}}{{{2|}}}|{{{1|}}}{{{2|}}}]]".

[edit] See also

The above documentation is transcluded from Template:Concat/doc. (edit | history)
Editors can experiment in this template's sandbox (create) and testcases (create) pages.
Please add categories and interwikis to the /doc subpage. Subpages of this template.
Personal tools
Namespaces

Variants
Actions
Navigation
Community
Beyond the Web
Toolbox