Difference between revisions of "Template:DWT"

From blackwiki
Jump to navigation Jump to search
imported>AGK
m (Changed protection level of Template:DWT: Highly-visible template (between 700 and 1200 transclusions) (‎[edit=autoconfirmed] (indefinite) ‎[move=sysop] (indefinite)))
imported>Trappist the monk
(remove |first= support;)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#if:{{{first|}}} | {{formatnum:{{formatnum:{{{1|{{{amt}}}}}}|R}}}}&nbsp;{{{2|{{{unit}}}}}} tons [[Deadweight tonnage|deadweight]] (DWT) |{{{1|{{{amt}}}}}}&nbsp;[[Deadweight tonnage|DWT]]}}</includeonly><noinclude>{{template doc}}</noinclude>
+
<includeonly>{{formatnum:{{formatnum:{{{1|{{{amt}}}}}}|R}} }}{{#if:{{{disp|}}}<!--
 +
-->|{{#switch:{{{disp}}}
 +
      |long={{#if:{{{2|{{{unit}}}}}}|{{#ifeq:{{{2|{{{unit}}}}}}|metric|&nbsp;tonnes|{{#ifeq:{{{2|{{{unit}}}}}}|long|&nbsp;long tons|&nbsp;tons}} }}|}} {{#ifeq:{{{link|}}}|off|deadweight|[[Deadweight tonnage|deadweight]]}} (DWT)
 +
      |adj={{#if:{{{2|{{{unit}}}}}}|{{#ifeq:{{{2|{{{unit}}}}}}|metric|-tonne|{{#ifeq:{{{2|{{{unit}}}}}}|long|-long ton|-ton}} }}|}} {{#ifeq:{{{link|}}}|off|deadweight|[[Deadweight tonnage|deadweight]]}} (DWT)
 +
      |#default=&#32;<code style="font-size:100%; font-weight:normal" class="error">&#124;disp={{{disp}}}</code>
 +
    }}<!--
 +
-->|{{#if:{{{2|{{{unit}}}}}}|{{#ifeq:{{{2|{{{unit}}}}}}|metric|&nbsp;t|{{#ifeq:{{{2|{{{unit}}}}}}|long|&nbsp;LT}} }} }}&nbsp;{{#ifeq:{{{link|}}}|off|DWT|[[Deadweight tonnage|DWT]]}} }}<!--
 +
-->{{main other|{{#if:{{{first|}}}|<span style="font-size:100%; font-weight:normal" class="error"> DWT uses unsupported parameter ([[Template:DWT#Usage|help]])</span>[[Category:WPSHIPS:Template errors]]}}}}</includeonly><noinclude>{{template doc}}</noinclude>

Latest revision as of 11:52, 11 July 2017

50px Template documentation[view] [edit] [history] [purge]

Purpose

To show deadweight tonnage, whether expressed in metric or long tons, in a consistent manner. Also to introduce the units used and the intended meaning of the abbreviation DWT the first time it is used in an article.

Usage

{{DWT|number|unit|disp=|link=}}
Parameters
number: numerical value of the deadweight tonnage;
unit: specifies the units in which the dead weight tonnage is measured; use long or metric;
disp: controls how the template will render in the page:
|disp= when empty or omitted, displays the abbreviated form:
{{DWT|36,000|metric|disp=}} → 36,000 t DWT
|disp=long creates a verbose description suitable for the first occurrence on a page
{{DWT|36,000|metric|disp=long}} → 36,000 tonnes deadweight (DWT)
|disp=adj creates the adjectival form:
{{DWT|36,000|metric|disp=adj}} → 36,000-tonne deadweight (DWT)
link: controls when the template output is linked to the deadweight tonnage article
|link= when empty or omitted, links to the deadweight tonnage article; this is the default;
{{DWT|36,000|metric|disp=long|link=}} → 36,000 tonnes deadweight (DWT)
|link=off instances of the rendered template are not linked to the deadweight tonnage article:
{{DWT|36,000|metric|disp=long|link=off}} → 36,000 tonnes deadweight (DWT)

Examples

Input Displays as
{{DWT|36,000|metric|disp=long}} 36,000 tonnes deadweight (DWT)
{{DWT|36,000|long|disp=long}} 36,000 long tons deadweight (DWT)
{{DWT|36,000|metric}} 36,000 t DWT
{{DWT|36,000|long}} 36,000 LT DWT
{{DWT|36,000}} 36,000 DWT
  1. REDIRECT Template:WPSHIPS: Measurement templates


  • From a page move: This is a redirect from a page that has been moved (renamed). This page was kept as a redirect to avoid breaking links, both internal and external, that may have been made to the old page name.