Difference between revisions of "Template:Component/doc"

From blackwiki
Jump to navigation Jump to search
imported>Petr Matas
imported>Petr Matas
Line 8: Line 8:
 
''Note:'' If you need to extract multiple components of a large item, consider using {{tl|Format item}} instead of multiple calls to {{tl|Component}}, because each call to {{tl|Component}} requires unpacking of the entire item, which may be costly.
 
''Note:'' If you need to extract multiple components of a large item, consider using {{tl|Format item}} instead of multiple calls to {{tl|Component}}, because each call to {{tl|Component}} requires unpacking of the entire item, which may be costly.
  
{| class=wikitable
+
== Examples ==
|+ Examples
+
{{Automarkup
! Code !! Result
+
|1= {{((}}Component {{!}} {{((}}Item{{!}}Alice{{!}}Bob{{!}}best=Eve{{))}} {{!}} 1{{))}}
|-
+
|2= {{((}}Component {{!}} {{((}}Item{{!}}Alice{{!}}Bob{{!}}best=Eve{{))}} {{!}} best{{))}}
|<pre>{{Component | {{Item|Alice|Bob|best=Eve}} | 1}}</pre>
+
}}
|    {{Component | {{Item|Alice|Bob|best=Eve}} | 1}}
 
|-
 
|<pre>{{Component | {{Item|Alice|Bob|best=Eve}} | best}}</pre>
 
|    {{Component | {{Item|Alice|Bob|best=Eve}} | best}}
 
|}
 
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
 
[[Category:Wikipedia formatting and function templates]]
 
[[Category:Wikipedia formatting and function templates]]
 
}}</includeonly>
 
}}</includeonly>

Revision as of 23:04, 15 December 2015

This template extracts a given component from a given item.

Usage

{{Component|Item|ParameterName}}

Note: If you need to extract multiple components of a large item, consider using {{Format item}} instead of multiple calls to {{Component}}, because each call to {{Component}} requires unpacking of the entire item, which may be costly.

Examples

Markup Renders as
{{Component | {{Item|Alice|Bob|best=Eve}} | 1}}

Alice

{{Component | {{Item|Alice|Bob|best=Eve}} | best}}

Eve