Difference between revisions of "Template:Infobox unit/sandbox"
imported>Sardanaphalus (Reset with current main template) |
imported>Sardanaphalus (Infobox) |
||
| Line 1: | Line 1: | ||
| − | + | {{Infobox | |
| − | + | | bodystyle = background:{{{bgcolor|}}}; | |
| − | + | | abovestyle = font-style:italic; | |
| − | + | | above = {{{name|{{SUBPAGENAME}}}}} | |
| − | -- | + | | image = {{{image|}}} |
| − | + | | caption = {{{caption|}}} | |
| − | | | + | | headerclass = navbox-title |
| + | | labelstyle = padding-top:0.225em;line-height:1.1em; font-weight:normal; padding-right:0.65em; | ||
| + | | datastyle = line-height:1.3em; | ||
| − | + | <!------------------- Unit information --------------------> | |
| − | + | | header1 = {{#if:{{{image|}}} |Unit information}} | |
| − | + | ||
| − | }} | + | | label2 = '''[[System of measurement|Unit system]]''' |
| − | + | | data2 = {{{standard|}}} | |
| − | + | ||
| − | | | + | | label3 = '''Unit of''' |
| − | + | | data3 = {{{quantity|}}} | |
| − | | | + | |
| − | {{ | + | | label4 = '''Symbol''' |
| − | + | | data4 = {{#if:{{{symbol|}}} |{{{symbol}}} {{#if:{{{symbol2|}}}|or {{{symbol2|}}} }} }} | |
| − | + | ||
| − | | | + | | label5 = '''Named after''' |
| − | {{#if:{{{ | + | | data5 = {{{namedafter|}}} |
| − | + | ||
| − | }} | + | | label6 = '''{{{extralabel|}}}''' |
| − | | | + | | data6 = {{{extradata|}}} |
| − | {{ | + | |
| − | + | <!------------------- Unit conversions --------------------> | |
| − | + | | header10 = | |
| − | + | {{#ifexpr: ({{#if:{{{units1|}}}|1|0}} and {{#if:{{{inunits1|}}}|1|0}}) | |
| − | + | or ({{#if:{{{units2|}}}|1|0}} and {{#if:{{{inunits2|}}}|1|0}}) | |
| − | + | or ({{#if:{{{units3|}}}|1|0}} and {{#if:{{{inunits3|}}}|1|0}}) | |
| − | + | or ({{#if:{{{units4|}}}|1|0}} and {{#if:{{{inunits4|}}}|1|0}}) | |
| − | + | or ({{#if:{{{units5|}}}|1|0}} and {{#if:{{{inunits5|}}}|1|0}}) | |
| − | }} | + | or ({{#if:{{{units6|}}}|1|0}} and {{#if:{{{inunits6|}}}|1|0}}) |
| − | + | | Unit conversions | |
| − | {{#if:{{{ | + | <tr class="nowrap"><td>''1 {{{symbol|unit}}} in ...''</td><td>''... is equal to ...''</td></tr> |
| − | + | }} | |
| − | }} | + | |
| − | + | | label12 = {{nbsp|3}}{{{units1|}}} | |
| − | {{#if:{{{ | + | | data12 = {{#ifexpr:({{#if:{{{units1|}}}|1|0}} and {{#if:{{{inunits1|}}}|1|0}}) |{{nbsp|3}}{{{inunits1|}}} }} |
| − | + | ||
| − | }} | + | | label13 = {{nbsp|3}}{{{units2|}}} |
| − | + | | data13 = {{#ifexpr:({{#if:{{{units2|}}}|1|0}} and {{#if:{{{inunits2|}}}|1|0}}) |{{nbsp|3}}{{{inunits2|}}} }} | |
| − | + | ||
| − | + | | label14 = {{nbsp|3}}{{{units3|}}} | |
| − | + | | data14 = {{#ifexpr:({{#if:{{{units3|}}}|1|0}} and {{#if:{{{inunits3|}}}|1|0}}) |{{nbsp|3}}{{{inunits3|}}} }} | |
| − | + | ||
| − | + | | label15 = {{nbsp|3}}{{{units4|}}} | |
| − | + | | data15 = {{#ifexpr:({{#if:{{{units4|}}}|1|0}} and {{#if:{{{inunits4|}}}|1|0}}) |{{nbsp|3}}{{{inunits4|}}} }} | |
| − | + | ||
| − | + | | label16 = {{nbsp|3}}{{{units5|}}} | |
| − | {{ | + | | data16 = {{#ifexpr:({{#if:{{{units5|}}}|1|0}} and {{#if:{{{inunits5|}}}|1|0}}) |{{nbsp|3}}{{{inunits5|}}} }} |
| − | {{ | + | |
| − | { | + | | label17 = {{nbsp|3}}{{{units6|}}} |
| − | + | | data17 = {{#ifexpr:({{#if:{{{units6|}}}|1|0}} and {{#if:{{{inunits6|}}}|1|0}}) |{{nbsp|3}}{{{inunits6|}}} }} | |
| − | + | ||
| − | }} | + | <!------------- Unit conversions (imperial) ---------------> |
| − | + | | header20 = | |
| − | + | {{#ifexpr: ({{#if:{{{units_imp1|}}}|1|0}} and {{#if:{{{inunits_imp1|}}}|1|0}}) | |
| − | + | or ({{#if:{{{units_imp2|}}}|1|0}} and {{#if:{{{inunits_imp2|}}}|1|0}}) | |
| − | }} | + | or ({{#if:{{{units_imp3|}}}|1|0}} and {{#if:{{{inunits_imp3|}}}|1|0}}) |
| − | + | or ({{#if:{{{units_imp4|}}}|1|0}} and {{#if:{{{inunits_imp4|}}}|1|0}}) | |
| − | + | or ({{#if:{{{units_imp5|}}}|1|0}} and {{#if:{{{inunits_imp5|}}}|1|0}}) | |
| − | + | or ({{#if:{{{units_imp6|}}}|1|0}} and {{#if:{{{inunits_imp6|}}}|1|0}}) | |
| − | + | | Unit conversions (imperial) | |
| − | + | <tr class="nowrap"><td>''1 imp {{{symbol|unit}}} in ...''</td><td>''... is equal to ...''</td></tr> | |
| − | + | }} | |
| − | + | ||
| − | + | | label22 = {{nbsp|3}}{{{units_imp1|}}} | |
| − | + | | data22 = {{#ifexpr:({{#if:{{{units_imp1|}}}|1|0}} and {{#if:{{{inunits_imp1|}}}|1|0}}) |{{nbsp|3}}{{{inunits_imp1|}}} }} | |
| − | + | ||
| − | + | | label23 = {{nbsp|3}}{{{units_imp2|}}} | |
| − | }} | + | | data23 = {{#ifexpr:({{#if:{{{units_imp2|}}}|1|0}} and {{#if:{{{inunits_imp2|}}}|1|0}}) |{{nbsp|3}}{{{inunits_imp2|}}} }} |
| − | + | ||
| − | + | | label24 = {{nbsp|3}}{{{units_imp3|}}} | |
| − | + | | data24 = {{#ifexpr:({{#if:{{{units_imp3|}}}|1|0}} and {{#if:{{{inunits_imp3|}}}|1|0}}) |{{nbsp|3}}{{{inunits_imp3|}}} }} | |
| − | + | ||
| − | }} | + | | label25 = {{nbsp|3}}{{{units_imp4|}}} |
| − | + | | data25 = {{#ifexpr:({{#if:{{{units_imp4|}}}|1|0}} and {{#if:{{{inunits_imp4|}}}|1|0}}) |{{nbsp|3}}{{{inunits_imp4|}}} }} | |
| − | + | ||
| − | + | | label26 = {{nbsp|3}}{{{units_imp5|}}} | |
| − | + | | data26 = {{#ifexpr:({{#if:{{{units_imp5|}}}|1|0}} and {{#if:{{{inunits_imp5|}}}|1|0}}) |{{nbsp|3}}{{{inunits_imp5|}}} }} | |
| − | ( | + | |
| − | + | | label27 = {{nbsp|3}}{{{units_imp6|}}} | |
| − | + | | data27 = {{#ifexpr:({{#if:{{{units_imp6|}}}|1|0}} and {{#if:{{{inunits_imp6|}}}|1|0}}) |{{nbsp|3}}{{{inunits_imp6|}}} }} | |
| − | + | ||
| − | + | <!---------------- Unit conversions (US) ------------------> | |
| − | {{ | + | | header30 = |
| − | {{ | + | {{#ifexpr: ({{#if:{{{units_us1|}}}|1|0}} and {{#if:{{{inunits_us1|}}}|1|0}}) |
| − | + | or ({{#if:{{{units_us2|}}}|1|0}} and {{#if:{{{inunits_us2|}}}|1|0}}) | |
| − | + | or ({{#if:{{{units_us3|}}}|1|0}} and {{#if:{{{inunits_us3|}}}|1|0}}) | |
| − | + | or ({{#if:{{{units_us4|}}}|1|0}} and {{#if:{{{inunits_us4|}}}|1|0}}) | |
| − | }} | + | or ({{#if:{{{units_us5|}}}|1|0}} and {{#if:{{{inunits_us5|}}}|1|0}}) |
| − | + | or ({{#if:{{{units_us6|}}}|1|0}} and {{#if:{{{inunits_us6|}}}|1|0}}) | |
| − | + | | Unit conversions (US) | |
| − | + | <tr class="nowrap"><td>''1 US {{{symbol|unit}}} in ...''</td><td>''... is equal to ...''</td></tr> | |
| − | }} | + | }} |
| − | + | ||
| − | {{# | + | | label32 = {{nbsp|3}}{{{units_us1|}}} |
| − | + | | data32 = {{#ifexpr:({{#if:{{{units_us1|}}}|1|0}} and {{#if:{{{inunits_us1|}}}|1|0}}) |{{nbsp|3}}{{{inunits_us1|}}} }} | |
| − | }} | + | |
| − | {{ | + | | label33 = {{nbsp|3}}{{{units_us2|}}} |
| − | + | | data33 = {{#ifexpr:({{#if:{{{units_us2|}}}|1|0}} and {{#if:{{{inunits_us2|}}}|1|0}}) |{{nbsp|3}}{{{inunits_us2|}}} }} | |
| − | + | ||
| − | }} | + | | label34 = {{nbsp|3}}{{{units_us3|}}} |
| − | + | | data34 = {{#ifexpr:({{#if:{{{units_us3|}}}|1|0}} and {{#if:{{{inunits_us3|}}}|1|0}}) |{{nbsp|3}}{{{inunits_us3|}}} }} | |
| − | + | ||
| − | + | | label35 = {{nbsp|3}}{{{units_us4|}}} | |
| − | }} | + | | data35 = {{#ifexpr:({{#if:{{{units_us4|}}}|1|0}} and {{#if:{{{inunits_us4|}}}|1|0}}) |{{nbsp|3}}{{{inunits_us4|}}} }} |
| − | + | ||
| − | + | | label36 = {{nbsp|3}}{{{units_us5|}}} | |
| − | + | | data36 = {{#ifexpr:({{#if:{{{units_us5|}}}|1|0}} and {{#if:{{{inunits_us5|}}}|1|0}}) |{{nbsp|3}}{{{inunits_us5|}}} }} | |
| − | }} | + | |
| − | + | | label37 = {{nbsp|3}}{{{units_us6|}}} | |
| − | + | | data37 = {{#ifexpr:({{#if:{{{units_us6|}}}|1|0}} and {{#if:{{{inunits_us6|}}}|1|0}}) |{{nbsp|3}}{{{inunits_us6|}}} }} | |
| − | + | ||
| − | + | }}<noinclude>{{Documentation}}</noinclude> | |
| − | |||
| − | ( | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | {{ | ||
| − | {{ | ||
| − | |||
| − | |||
| − | |||
| − | }} | ||
| − | |||
| − | |||
| − | |||
| − | }} | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | }} | ||
| − | |||
| − | |||
Revision as of 07:40, 7 July 2014
| sandbox |
|---|
| 50px | This is the template sandbox page for Template:Infobox unit (diff). See also the companion subpage for test cases. |
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 A⋅s | 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 = 300px
| caption =| 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]]
}}
|
| The above documentation is transcluded from Template:Infobox unit/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |