Template:M/Y/doc
| This is a documentation subpage for Template:M/Y. It contains usage information, categories and other content that is not part of the original template page. |
| This subpage Template:M/Y is not related to parent page Template:M. It is located here for technical reasons (having a "/" slash in its title). See parent template {{Ship}} (talk). |
This template links to an unslashed target page [[Template:NnbspMY Jairo Mora SandovalTemplate:Nnbsp]], but it shows the slash: "M/Y": Template:Ship/special
Contents
Usage
- To show "MY" (unslashed), use {{MY}}: MY Jairo Mora Sandoval
- When the target pagename has a "/" slash, use {{Ship}}:
- Target: [[Template:NnbspS/Y ManitouTemplate:Nnbsp]]
- Use:
{{ship|S/Y|Manitou}}→ S/Y Manitou
Usage
This is a typing short cut for linking to steamship articles named in the format "MY Shipname (year)", showing "M/Y". Since ship names are italicized in article text, linking to them in the usual manner means typing everything twice, such as [[MY Shipname (ID)|M/Y ''Shipname'' (ID)]]. This template halves that to {{M/Y|Shipname|ID}}.
Formal Usage
{{M/Y|Ship Name}}{{M/Y|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/Y|Jairo Mora Sandoval|}}
|
[[MY Jairo Mora Sandoval ()|M/Y ''Jairo Mora Sandoval'' ()]]
|
Template:Ship/special |
{{M/Y|Queen Victoria|ship}}
|
[[MY Queen Victoria (ship)|M/Y ''Queen Victoria'' (ship)]]
|
Template:Ship/special |
{{M/Y|Princess of Norway}}
|
[[MY Princess of Norway|M/Y ''Princess of Norway'']]
|
Template:Ship/special |
Label format options
- To show "M/Y", use {{M/Y}}: Template:Ship/special
- To link to S/Y Manitou, use {{Ship|S/Y|Manitou}}
By default, the wikilink is build like this:
{{M/Y|Jairo Mora Sandoval|}}, the targetpage is
[[MY Jairo Mora Sandoval]].- Then the template by default adds the formatted label:
[[targetpage|label]][[MY Jairo Mora Sandoval ()|M/Y ''Jairo Mora Sandoval'' ()]], 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:
{{MY|Jairo Mora Sandoval||2}}→
[[MY Jairo Mora Sandoval ()|''Jairo Mora Sandoval'']]→- Template:Ship/special
The options are:
| Value | Will show | Example | Wikilink [[targetpage|label]] | Shows |
|---|---|---|---|---|
| (default) | PREFIX name (ID) | {{M/Y|Jairo Mora Sandoval|}} | [[MY Jairo Mora Sandoval ()|M/Y ''Jairo Mora Sandoval'' ()]] | Template:Ship/special |
| 1 | ID | {{M/Y|Jairo Mora Sandoval||1}} | [[MY Jairo Mora Sandoval ()|'''']] | Template:Ship/special |
| 2 | name | {{M/Y|Jairo Mora Sandoval||2}} | [[MY Jairo Mora Sandoval ()|''Jairo Mora Sandoval'']] | Template:Ship/special |
| 3 | name (ID) | {{M/Y|Jairo Mora Sandoval||3}} | [[MY Jairo Mora Sandoval ()|''Jairo Mora Sandoval'' ()]] | Template:Ship/special |
| 4 (dflt) | PREFIX name (ID) | {{M/Y|Jairo Mora Sandoval||4}} | [[MY Jairo Mora Sandoval ()|M/Y ''Jairo Mora Sandoval'' ()]] | Template:Ship/special |
| 5 | PREFIX ID | {{M/Y|Jairo Mora Sandoval||5}} | [[MY Jairo Mora Sandoval ()|M/Y '''']] | Template:Ship/special |
| 6 | PREFIX name | {{M/Y|Jairo Mora Sandoval||6}} | [[MY Jairo Mora Sandoval ()|M/Y ''Jairo Mora Sandoval'']] | 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