Difference between revisions of "Template:Infobox unit/sandbox"

From blackwiki
Jump to navigation Jump to search
imported>Szqecs
imported>Szqecs
Line 6: Line 6:
 
| headerclass =  
 
| headerclass =  
  
<!------------------- Unit information -------------------->
+
<!------------------- General information -------------------->
 
| header1 = {{#if:{{{image|}}} |General information}}
 
| header1 = {{#if:{{{image|}}} |General information}}
  
Line 24: Line 24:
 
|  data6  = {{{extradata|}}}
 
|  data6  = {{{extradata|}}}
  
<!------------------- Unit conversions -------------------->
+
<!------------------- Conversions -------------------->
 
| header11 =
 
| header11 =
 
   {{#ifexpr: ({{#if:{{{units1|}}}|1|0}} and {{#if:{{{inunits1|}}}|1|0}})
 
   {{#ifexpr: ({{#if:{{{units1|}}}|1|0}} and {{#if:{{{inunits1|}}}|1|0}})
Line 54: Line 54:
 
|  data17 = {{#ifexpr:({{#if:{{{units6|}}}|1|0}} and {{#if:{{{inunits6|}}}|1|0}}) |{{nbsp|3}}{{{inunits6|}}} }}
 
|  data17 = {{#ifexpr:({{#if:{{{units6|}}}|1|0}} and {{#if:{{{inunits6|}}}|1|0}}) |{{nbsp|3}}{{{inunits6|}}} }}
  
<!------------- Unit conversions (imperial) --------------->
+
<!------------- Conversions (imperial) --------------->
 
| header21 =  
 
| header21 =  
 
   {{#ifexpr: ({{#if:{{{units_imp1|}}}|1|0}} and {{#if:{{{inunits_imp1|}}}|1|0}})
 
   {{#ifexpr: ({{#if:{{{units_imp1|}}}|1|0}} and {{#if:{{{inunits_imp1|}}}|1|0}})
Line 84: Line 84:
 
|  data27 = {{#ifexpr:({{#if:{{{units_imp6|}}}|1|0}} and {{#if:{{{inunits_imp6|}}}|1|0}}) |{{nbsp|3}}{{{inunits_imp6|}}} }}
 
|  data27 = {{#ifexpr:({{#if:{{{units_imp6|}}}|1|0}} and {{#if:{{{inunits_imp6|}}}|1|0}}) |{{nbsp|3}}{{{inunits_imp6|}}} }}
  
<!---------------- Unit conversions (US) ------------------>
+
<!---------------- Conversions (US) ------------------>
 
| header31 =  
 
| header31 =  
 
   {{#ifexpr: ({{#if:{{{units_us1|}}}|1|0}} and {{#if:{{{inunits_us1|}}}|1|0}})
 
   {{#ifexpr: ({{#if:{{{units_us1|}}}|1|0}} and {{#if:{{{inunits_us1|}}}|1|0}})

Revision as of 14:24, 18 November 2018

sandbox
Template documentation[view] [edit] [history] [purge]

Template:Parameter names example

Syntax and parameters

{{Infobox unit
| bgcolor      = 
| name         = 
| image        = 
| caption      = 
| standard     = 
| quantity     = 
| symbol       = 
| symbol2      = 
| symbol3      = 
| namedafter   = 
| extralabel   = 
| extradata    = 
| units1       = 
| inunits1     = 
<!--...-->
| units6       = 
| inunits6     = 
| units_imp1   = 
| inunits_imp1 = 
<!--...-->
| units_imp6   = 
| inunits_imp6 = 
| units_us1    = 
| inunits_us1  = 
<!--...-->
| units_us6    = 
| inunits_us6  = 
}}
Parameter Description
bgcolor The colour of the background of the table
name The name of the unit (defaults to {{PAGENAME}}). Capitalize the name as if it appeared in the middle of a sentence, for example, "watt" rather than "Watt".
image The image for the infobox (use full wikicode)
caption A caption for the image
standard The unit system (system of measurement) of which the unit is a part (e.g. SI)
quantity The type of quantity of which it is a unit
symbol The symbol used for the unit
symbol2 A secondary, alternative symbol for the unit
symbol3 A tertiary symbol for the unit
namedafter The person after which the unit is named
extraheader
extralabel
extradata
extraheader2
extralabel2
extradata2
Miscellaneous (e.g., a unit conversion if only one is given)
inunitsN Conversions: the unit expressed in {{{unitsN}}}, where N can be 1 to 6
inunits_impN Imperial conversions: the unit expressed in {{{units_impN}}}, where N can be 1 to 6
inunits_usN U.S. conversions: the unit expressed in {{{units_usN}}}, where N can be 1 to 6

Examples

Coulomb

{{Infobox unitTemplate:\sandbox | name = coulomb | standard = SI derived unit | quantity = electric charge | symbol = C | namedafter = Charles-Augustin de Coulomb | units1 = SI base units | inunits1 = 1 As | units2 = CGS units | inunits2 = Template:Val statC | units3 = Natural units | inunits3 = Template:Val e }}

{{Infobox unit
| name = coulomb
| standard = [[SI derived unit]]
| quantity = [[electric charge]]
| symbol = C
| namedafter = [[Charles-Augustin de Coulomb]]
| units1 = [[SI base unit]]s
| inunits1 = 1 [[Ampere|A]]⋅[[Second|s]]
| units2 = [[CGS unit]]s
| inunits2 = {{val|2997924580}} [[Statcoulomb|statC]]
| units3 = [[Natural units#Natural units (particle physics)|natural units]]
| inunits3 = {{val|6.242|e=18}} [[Elementary charge|''e'']]
}}

Kilogram

{{Infobox unitTemplate:\sandbox | name = kilogram | image = CGKilogram.jpg

| caption =
A computer-generated image of the IPK (International Prototype Kilogram). The IPK is the kilogram. It sits next to an inch-based ruler for scale.

| standard = SI base unit | quantity = mass | symbol = kg | units1 = U.S. customary | inunits1 = ≈Template:Val pounds | units2 = Natural units | inunits2 = ≈Template:Val }}

{{Infobox unit
| name = kilogram
| image = [[File:CGKilogram.jpg|300px]]
| caption = {{longitem|A computer-generated image of the IPK [...] }}
| standard = [[SI base unit]]
| quantity = [[mass]]
| symbol = kg
| units1 = [[United States customary units|U.S. customary]]
| inunits1 = ≈{{thin space}}{{val|2.205}} [[Pound (mass)|pounds]]
| units2 = [[natural units]]
| inunits2 = ≈{{thin space}}{{val|4.59|e=7|u=[[Planck mass]]es}}
}}

Hertz

{{Infobox unitTemplate:\sandbox | name = hertz | standard = SI derived unit | quantity = frequency | symbol = Hz | namedafter = Heinrich Hertz | extralabel = In SI base units | extradata = 1 Hz = 1/s }}

{{Infobox unit
| name = hertz 
| standard = [[SI derived unit]]
| quantity = [[frequency]]
| symbol = Hz
| namedafter = [[Heinrich Hertz]]
| extralabel = In [[SI base unit]]s
| extradata = 1 Hz = 1/[[Second|s]]
}}