Difference between revisions of "Template:M/S/doc"

From blackwiki
< Template:M‎ | S
Jump to navigation Jump to search
imported>DePiep
imported>DePiep
m (TemplateData: use central template form for all prefix ship templates (via WP:JWB))
Line 115: Line 115:
 
:{{small|1=''Note'': options default (=blank), 2 and 6 are most often used.}}
 
:{{small|1=''Note'': options default (=blank), 2 and 6 are most often used.}}
  
==Template data==
+
== TemplateData ==
{{TemplateDataHeader}}
+
{{Template:Ship/doc/fixed prefix: TemplateData}}
<templatedata>
 
{
 
"params": {
 
"1": {
 
"label": "Prefix",
 
"description": "Fleet identifier",
 
"example": "HMS, Japanese battleship",
 
"type": "string"
 
},
 
"2": {
 
"label": "Name",
 
"description": "Ship's name",
 
"example": "Bismarck, Belgrano",
 
"type": "string"
 
},
 
"3": {
 
"label": "ID",
 
"description": "Hull number, launch year, or pennanr number",
 
"example": "H75, 1975, ",
 
"type": "string"
 
},
 
"4": {
 
"label": "Format",
 
"description": "Formats label (parts showing)",
 
"example": "1, 2, 3, 5, 6",
 
"default": "blank",
 
"type": "number"
 
},
 
"up": {
 
"label": "unlink prefix",
 
"description": "yes=puts Fleet ID outside of Wikilink",
 
"example": "up=yes",
 
"default": "no",
 
"type": "boolean"
 
}
 
},
 
"description": "This template provides a wikilink to a ship's page, with label options",
 
"paramOrder": [
 
"1",
 
"2",
 
"3",
 
"4",
 
"up"
 
]
 
}
 
</templatedata>
 
  
 
== See also ==
 
== See also ==

Revision as of 17:44, 19 March 2018

Usage

This template links to an unslashed target page [[Template:NnbspMS Antenor (1957)Template:Nnbsp]] and shows the slash: Template:Ship/special

  • When the target pagename has a "/" slash, use {{Ship}}:
Target: [[Template:NnbspS/Y ManitouTemplate:Nnbsp]]
Use: {{ship|S/Y|Manitou}}S/Y Manitou

Formal Usage

  • {{M/S|Ship Name}}
  • {{M/S|Ship Name|ID}}, where ID can be the hull number, launch year, or pennant number, as specified in the article title.

Examples

Template usage Equivalent wikicode Final result
{{M/S|Antenor|1957}} [[MS Antenor (1957)|M/S ''Antenor'' (1957)]] Template:Ship/special
{{M/S|Queen Victoria|ship}} [[MS Queen Victoria (ship)|M/S ''Queen Victoria'' (ship)]] Template:Ship/special
{{M/S|Princess of Norway}} [[MS Princess of Norway|M/S ''Princess of Norway'']] Template:Ship/special

Label format options

By default, the wikilink is build like this:

  • {{M/S|Antenor|1957}}, the targetpage is
[[MS Antenor (1957)]].
Then the template by default adds the formatted label:
[[targetpage|label]]
[[MS Antenor (1957)|M/S ''Antenor'' (1957)]], showing as:
Template:Ship/special.

The default label can be changed with a simple parameter. The extra third position, unnamed parameter allows setting which elements of the ship's full name are shown in the wikilink. It sets the label in the link: For example, in your article, the hull number (disambiguator) may not be needed to show. In that case, add option |2, and the result is:

  • {{MS|Antenor|1957|2}}
[[MS Antenor (1957)|''Antenor'']]
Template:Ship/special

The options are:

Value Will show Example Wikilink [[targetpage|label]] Shows
(default) PREFIX name (ID) {{M/S|Antenor|1957}} [[MS Antenor (1957)|M/S ''Antenor'' (1957)]] Template:Ship/special
1 ID {{M/S|Antenor|1957|1}} [[MS Antenor (1957)|''1957'']] Template:Ship/special
2 name {{M/S|Antenor|1957|2}} [[MS Antenor (1957)|''Antenor'']] Template:Ship/special
3 name (ID) {{M/S|Antenor|1957|3}} [[MS Antenor (1957)|''Antenor'' (1957)]] Template:Ship/special
4 (dflt) PREFIX name (ID) {{M/S|Antenor|1957|4}} [[MS Antenor (1957)|M/S ''Antenor'' (1957)]] Template:Ship/special
5 PREFIX ID {{M/S|Antenor|1957|5}} [[MS Antenor (1957)|M/S ''1957'']] Template:Ship/special
6 PREFIX name {{M/S|Antenor|1957|6}} [[MS Antenor (1957)|M/S ''Antenor'']] Template:Ship/special
Note: options default (=blank), 2 and 6 are most often used.

TemplateData

Template:Ship/doc/fixed prefix: TemplateData

See also

Template:WPSHIPS shortcut templates