Difference between revisions of "Template:M/S/doc"
imported>DePiep |
imported>DePiep |
||
| Line 11: | Line 11: | ||
| plainlinks = no | | plainlinks = no | ||
}} | }} | ||
| + | This template links to an unslashed target page <nowiki>[[</nowiki>{{nnbsp}}[[MS Antenor (1957)]]{{nnbsp}}]], but it shows the slash: "M/S": {{M/S|Antenor|1957}} | ||
| + | |||
== Usage == | == Usage == | ||
| − | * | + | * To show "MS" (unslashed), use {{tl|MS}}: {{MS|Antenor|1957}} |
| − | |||
| − | : | ||
* When the target pagename has a "/" slash, use {{tl|Ship}}: | * When the target pagename has a "/" slash, use {{tl|Ship}}: | ||
:Target: <nowiki>[[</nowiki>{{nnbsp}}[[S/Y Manitou]]{{nnbsp}}]] | :Target: <nowiki>[[</nowiki>{{nnbsp}}[[S/Y Manitou]]{{nnbsp}}]] | ||
| − | :<code><nowiki>{{</nowiki>ship|S/Y|Manitou}}</code> → {{ship|S/Y|Manitou}} | + | :Use: <code><nowiki>{{</nowiki>ship|S/Y|Manitou}}</code> → {{ship|S/Y|Manitou}} |
| + | |||
| + | == Usage == | ||
| + | This is a typing short cut for linking to steamship articles named in the format "MS Shipname (year)", showing "M/S". Since ship names are italicized in article text, linking to them in the usual manner means typing everything twice, such as <nowiki>[[MS Shipname (ID)|M/S ''Shipname'' (ID)]]</nowiki>. This template halves that to <nowiki>{{M/S|Shipname|ID}}. | ||
| + | </nowiki> | ||
| + | |||
| + | === Formal Usage === | ||
| + | |||
| + | * <code><nowiki>{{M/S|Ship Name}}</nowiki></code> | ||
| + | * <code><nowiki>{{M/S|Ship Name|ID}}</nowiki></code>, where ID can be the [[hull number]], launch year, or [[pennant number]], as specified in the article title. | ||
| + | |||
| + | =again= | ||
| + | === Examples === | ||
| + | {|class=wikitable width="100%" | ||
| + | |- style="background-color:#FCFCFC" align="left" | ||
| + | ! Template usage | ||
| + | ! Equivalent wikicode | ||
| + | ! Final result | ||
| + | |- | ||
| + | | <tt><nowiki>{{MS|Antenor|1957}}</nowiki></tt> | ||
| + | | <tt><nowiki>[[MS Antenor (1957)|MS ''Antenor'' (1957)]]</nowiki></tt> | ||
| + | | {{MS|Antenor|1957}} | ||
| + | |- | ||
| + | | <tt><nowiki>{{MS|Queen Victoria|ship}}</nowiki></tt> <!-- I know that this is a redirect, but it linked to show an example of this template --> | ||
| + | | <tt><nowiki>[[MS Queen Victoria (ship)|MS ''Queen Victoria'' (ship)]]</nowiki></tt> | ||
| + | | {{MS|Queen Victoria|ship}} | ||
| + | |- | ||
| + | | <tt><nowiki>{{MS|Princess of Norway}}</nowiki></tt> | ||
| + | | <tt><nowiki>[[MS Princess of Norway|MS ''Princess of Norway'']]</nowiki></tt> | ||
| + | | {{MS|Princess of Norway}} | ||
| + | |} | ||
| + | |||
| + | ==Label format options== | ||
| + | * To show "M/S", use {{tl|M/S}}: {{M/S|Antenor|1957}} | ||
| + | * To link to [[S/Y Manitou]], use <nowiki>{{Ship|S/Y|Manitou}}</nowiki> | ||
| + | |||
| + | By default, the wikilink is build like this: | ||
| + | * <code><nowiki>{{MS|Antenor|1957}}</nowiki></code>, the targetpage is | ||
| + | : {{nowrap|1=<code><nowiki>[[MS Antenor (1957)]]</nowiki></code>}}. | ||
| + | :Then the template by default adds the formatted label: | ||
| + | :<code><nowiki>[[targetpage|label]]</nowiki></code> | ||
| + | :<code><nowiki>[[MS Antenor (1957)|MS ''Antenor'' (1957)]]</nowiki></code>, showing as: | ||
| + | : {{nowrap|1={{MS|Antenor|1957}}}}. | ||
| + | |||
| + | 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 {{para||2}}, and the result is: | ||
| + | * <code><nowiki>{{</nowiki>MS|Antenor|1957<span style="background:yellow;">|2</span>}}</code> → | ||
| + | :<code><nowiki>[[MS Antenor (1957)|''Antenor'']]</nowiki></code> → | ||
| + | :{{MS|Antenor|1957|2}} | ||
| + | |||
| + | The options are: | ||
| + | {|class=wikitable style="font-size: 90%; text-align: left; width: 100%;" | ||
| + | ! Value | ||
| + | ! Will show | ||
| + | ! Example | ||
| + | ! Wikilink {{nobold|1=<nowiki>[[targetpage|label]]</nowiki>}} | ||
| + | ! Shows | ||
| + | |- | ||
| + | ! {{nobold|1=(default)}} | ||
| + | | PREFIX ''name'' (ID) | ||
| + | | <nowiki>{{MS|Antenor|1957}}</nowiki> | ||
| + | | <nowiki>[[MS Antenor (1957)|MS ''Antenor'' (1957)]]</nowiki> | ||
| + | | {{MS|Antenor|1957}} | ||
| + | |- | ||
| + | ! 1 | ||
| + | | ''ID'' | ||
| + | | <nowiki>{{MS|Antenor|1957|1}}</nowiki> | ||
| + | | <nowiki>[[MS Antenor (1957)|''1957'']]</nowiki> | ||
| + | | {{MS|Antenor|1957|1}} | ||
| + | |- | ||
| + | ! 2 | ||
| + | | ''name'' | ||
| + | | <nowiki>{{MS|Antenor|1957|2}}</nowiki> | ||
| + | | <nowiki>[[MS Antenor (1957)|''Antenor'']]</nowiki> | ||
| + | | {{MS|Antenor|1957|2}} | ||
| + | |- | ||
| + | ! 3 | ||
| + | | ''name'' (ID) | ||
| + | | <nowiki>{{MS|Antenor|1957|3}}</nowiki> | ||
| + | | <nowiki>[[MS Antenor (1957)|''Antenor'' (1957)]]</nowiki> | ||
| + | | {{MS|Antenor|1957|3}} | ||
| + | |- | ||
| + | ! 4 {{nobold|1=<small>(dflt)</small>}} | ||
| + | | PREFIX ''name'' (ID) | ||
| + | | <nowiki>{{MS|Antenor|1957|4}}</nowiki> | ||
| + | | <nowiki>[[MS Antenor (1957)|MS ''Antenor'' (1957)]]</nowiki> | ||
| + | | {{MS|Antenor|1957|4}} | ||
| + | |- | ||
| + | ! 5 | ||
| + | | PREFIX ''ID'' | ||
| + | | <nowiki>{{MS|Antenor|1957|5}}</nowiki> | ||
| + | | <nowiki>[[MS Antenor (1957)|MS ''1957'']]</nowiki> | ||
| + | | {{MS|Antenor|1957|5}} | ||
| + | |- | ||
| + | ! 6 | ||
| + | | PREFIX ''name'' | ||
| + | | <nowiki>{{MS|Antenor|1957|6}}</nowiki> | ||
| + | | <nowiki>[[MS Antenor (1957)|MS ''Antenor'']]</nowiki> | ||
| + | | {{MS|Antenor|1957|6}} | ||
| + | |} | ||
| + | :{{small|1=''Note'': options default (=blank), 2 and 6 are mostly used.}}<!-- | ||
| + | |||
| + | --><noinclude>{{documentation}}</noinclude> | ||
| + | |||
| + | ==Template data== | ||
| + | {{TemplateDataHeader}} | ||
| + | <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 == | ||
| + | {{WPSHIPS shortcut templates}} | ||
| + | |||
| + | <includeonly>{{sandbox other|| | ||
| + | [[Category:Ship prefix templates]] | ||
| + | }}</includeonly> | ||
| − | |||
| − | |||
| − | |||
<includeonly>{{sandbox other|| | <includeonly>{{sandbox other|| | ||
<!-- {{Categories below this line, please; interwikis at Wikidata --> | <!-- {{Categories below this line, please; interwikis at Wikidata --> | ||
Revision as of 16:10, 16 March 2018
| This is a documentation subpage for Template:M/S. It contains usage information, categories and other content that is not part of the original template page. |
| This subpage Template:M/S 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:NnbspMS Antenor (1957)Template:Nnbsp]], but it shows the slash: "M/S": Template:Ship/special
Contents
Usage
- To show "MS" (unslashed), use {{MS}}: MS Antenor (1957)
- 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 "MS Shipname (year)", showing "M/S". Since ship names are italicized in article text, linking to them in the usual manner means typing everything twice, such as [[MS Shipname (ID)|M/S ''Shipname'' (ID)]]. This template halves that to {{M/S|Shipname|ID}}.
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.
again
Examples
| Template usage | Equivalent wikicode | Final result |
|---|---|---|
| {{MS|Antenor|1957}} | [[MS Antenor (1957)|MS ''Antenor'' (1957)]] | MS Antenor (1957) |
| {{MS|Queen Victoria|ship}} | [[MS Queen Victoria (ship)|MS ''Queen Victoria'' (ship)]] | MS Queen Victoria (ship) |
| {{MS|Princess of Norway}} | [[MS Princess of Norway|MS ''Princess of Norway'']] | MS Princess of Norway |
Label format options
- To show "M/S", use {{M/S}}: Template:Ship/special
- To link to S/Y Manitou, use {{Ship|S/Y|Manitou}}
By default, the wikilink is build like this:
{{MS|Antenor|1957}}, the targetpage is
[[MS Antenor (1957)]].- Then the template by default adds the formatted label:
[[targetpage|label]][[MS Antenor (1957)|MS ''Antenor'' (1957)]], showing as:- MS Antenor (1957).
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'']]→- Antenor
The options are:
| Value | Will show | Example | Wikilink [[targetpage|label]] | Shows |
|---|---|---|---|---|
| (default) | PREFIX name (ID) | {{MS|Antenor|1957}} | [[MS Antenor (1957)|MS ''Antenor'' (1957)]] | MS Antenor (1957) |
| 1 | ID | {{MS|Antenor|1957|1}} | [[MS Antenor (1957)|''1957'']] | 1957 |
| 2 | name | {{MS|Antenor|1957|2}} | [[MS Antenor (1957)|''Antenor'']] | Antenor |
| 3 | name (ID) | {{MS|Antenor|1957|3}} | [[MS Antenor (1957)|''Antenor'' (1957)]] | Antenor (1957) |
| 4 (dflt) | PREFIX name (ID) | {{MS|Antenor|1957|4}} | [[MS Antenor (1957)|MS ''Antenor'' (1957)]] | MS Antenor (1957) |
| 5 | PREFIX ID | {{MS|Antenor|1957|5}} | [[MS Antenor (1957)|MS ''1957'']] | MS 1957 |
| 6 | PREFIX name | {{MS|Antenor|1957|6}} | [[MS Antenor (1957)|MS ''Antenor'']] | MS Antenor |
- Note: options default (=blank), 2 and 6 are mostly used.
| Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |
Template data
TemplateData for M/S
This template provides a wikilink to a ship's page, with label options
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Prefix | 1 | Fleet identifier
| String | optional |
| Name | 2 | Ship's name
| String | optional |
| ID | 3 | Hull number, launch year, or pennanr number
| String | optional |
| Format | 4 | Formats label (parts showing)
| Number | optional |
| unlink prefix | up | yes=puts Fleet ID outside of Wikilink
| Boolean | optional |
See also
Template:WPSHIPS shortcut templates