Template:Infobox person/length/doc
| This is a documentation subpage for Template:Infobox person/length. It contains usage information, categories and other content that is not part of the original template page. |
| Warning | This template is used on approximately 7,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
| This is for use in templates. For articles, please use {{Convert}}. |
| File:Lua-Logo.svg | This template uses Lua: |
This template is used to automatically add conversions of length measurements displayed by infoboxes, such as:
|reach=in{{Infobox boxer}}and{{Infobox martial artist}}|spike=and|block=in{{Infobox volleyball biography}}
Usage[edit source]
{{Infobox
...
| label# = Reach
| data# = {{#if: {{{reach|}}} | {{Infobox person/length|{{{reach}}}}} }}
...
}}{{Infobox
...
| label# = Spike
| data# = {{#if: {{{spike|}}} | {{Infobox person/length|{{{spike}}}}} }}
| label# = Block
| data# = {{#if: {{{block|}}} | {{Infobox person/length|{{{block}}}}} }}
...
}}Examples[edit source]
|reach=1 inch→ Script error: No such module "Person length".|reach=78 inches→ Script error: No such module "Person length".|reach=78 ins→ Script error: No such module "Person length".|reach=78 in.→ Script error: No such module "Person length".|reach=78 in→ Script error: No such module "Person length".
|reach=1 centimetre→ Script error: No such module "Person length".|reach=1 centimeter→ Script error: No such module "Person length".|reach=198 centimetres→ Script error: No such module "Person length".|reach=198 centimeters→ Script error: No such module "Person length".|reach=198 cms→ Script error: No such module "Person length".|reach=198 cm.→ Script error: No such module "Person length".|reach=198 cm→ Script error: No such module "Person length".
|reach=1 metre→ Script error: No such module "Person length".|reach=1 meter→ Script error: No such module "Person length".|reach=1.98 metres→ Script error: No such module "Person length".|reach=1.98 meters→ Script error: No such module "Person length".|reach=1.98 ms→ Script error: No such module "Person length".|reach=1.98 m.→ Script error: No such module "Person length".|reach=1.98 m→ Script error: No such module "Person length".
Non-breaking space or missing space after number:
|reach=78 inches→ Script error: No such module "Person length".|reach=198centimetres→ Script error: No such module "Person length".|reach=1.98metres→ Script error: No such module "Person length".
Text and/or footnotes (references) after length:
|reach=78 ins (2012)→ Script error: No such module "Person length".|reach=198 cms<ref>citation goes here</ref>→ Script error: No such module "Person length".|reach=1.98 ms (2012)<ref>{{cite news|title=title|work=work}}</ref>→ Script error: No such module "Person length".
- Example references
{{Convert}} templates, without and with wikilinked unit names:
|reach={{Convert|78|in|cm|0|abbr=off}}→ Script error: No such module "Person length".|reach={{Convert|78|in|cm|0|abbr=off|lk=on}}→ Script error: No such module "Person length".- output of convert template: 78 [[inch|inches]] (198 [[centimetre]]s)
|reach={{Convert|78|in|m|2|abbr=off}}→ Script error: No such module "Person length".|reach={{Convert|78|in|m|2|abbr=off|lk=on}}→ Script error: No such module "Person length".- output of convert template: 78 [[inch|inches]] (1.98 [[metre]]s)
|reach={{Convert|198|cm|abbr=off}}→ Script error: No such module "Person length".|reach={{Convert|198|cm|abbr=off|lk=on}}→ Script error: No such module "Person length".- output of convert template: 198 [[centimetre]]s (78 [[inch|inches]])
|reach={{Convert|1.98|m|in|abbr=off}}→ Script error: No such module "Person length".|reach={{Convert|1.98|m|in|abbr=off|lk=on}}→ Script error: No such module "Person length".- output of convert template: 1.98 [[metre]]s (78 [[inch|inches]])
Exceptions[edit source]
Does not replace numbers in manually entered conversions, but does replace unit names with abbreviations (examples intentionally show incorrect conversions):
|reach=78 inches (191 centimeters)→ Script error: No such module "Person length".|reach=78 inches (1.91 meters)→ Script error: No such module "Person length".|reach=198 centimetres (71 inches)→ Script error: No such module "Person length".|reach=1.98 metres (71 inches)→ Script error: No such module "Person length".
Does not replace numeric output of conversion templates such as {{convert}}, but does replace unit names with abbreviations (examples intentionally show different precision than usual):
|reach={{convert|78|in|cm|1|abbr=off|sp=us}}→ Script error: No such module "Person length".- output of convert template: 78 inches (198.1 centimeters)
|reach={{convert|78|in|m|3|abbr=off|sp=us|lk=on}}→ Script error: No such module "Person length".|reach={{convert|198|cm|in|2|abbr=off|lk=on}}→ Script error: No such module "Person length".- output of convert template: 198 centimetres (77.95 inches)
|reach={{convert|1.98|m|in|2|abbr=off}}→ Script error: No such module "Person length".- output of convert template: 1.98 metres (77.95 inches)
Areas for improvement[edit source]
Conversion not displayed if unit name contains uppercase characters:
|reach=198 Centimetres→ Script error: No such module "Person length".|reach=198 CM→ Script error: No such module "Person length".|reach=1.98 Metres→ Script error: No such module "Person length".|reach=1.98 M→ Script error: No such module "Person length".|reach=78 Inches→ Script error: No such module "Person length".|reach=78 IN→ Script error: No such module "Person length".
Conversion not displayed if symbols are used for inches:
|reach=78"→ Script error: No such module "Person length".|reach=78″→ Script error: No such module "Person length".
Does not recognize symbols for inches in manually entered conversion (adds a second conversion):
|reach=198cm (78")→ Script error: No such module "Person length".|reach=1.98m (78″)→ Script error: No such module "Person length".
Does not convert feet (ft) or yards (yd):
|reach=6 feet→ Script error: No such module "Person length".|reach=6 ft→ Script error: No such module "Person length".|reach=2 yards→ Script error: No such module "Person length".|reach=2 yd→ Script error: No such module "Person length".
If {{convert}} template displays feet or yards, it is not abbreviated:
|reach={{Convert|6|ft|6|in|cm|abbr=off}}→ Script error: No such module "Person length".|reach={{Convert|6|ft|6|in|m|2|abbr=off|lk=on}}→ Script error: No such module "Person length".|reach={{Convert|2|yd|1.5|ft|cm|0|abbr=off}}→ Script error: No such module "Person length".|reach={{Convert|2|yd|1.5|ft|m|2|abbr=off|lk=on}}→ Script error: No such module "Person length".
If {{convert}} displays feet or yards in conversion, a second conversion is displayed (only for unlinked unit names):
|reach={{Convert|198|cm|ftin|abbr=off}}→ Script error: No such module "Person length".|reach={{Convert|1.98|m|ftin|abbr=off|lk=on}}→ Script error: No such module "Person length".|reach={{Convert|229|cm|ydft|1|abbr=off}}→ Script error: No such module "Person length".|reach={{Convert|2.29|m|ydft|1|abbr=off|lk=on}}→ Script error: No such module "Person length".