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

From blackwiki
< Template:M‎ | S
Jump to navigation Jump to search
imported>DePiep
imported>CommonsDelinker
(Replacing Ambox_Content.svg with File:Ambox_important.svg (by CommonsDelinker because: file renamed, redirect linked from other project).)
 
(11 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
| demospace = {{{demospace|}}} / main / talk / file / category / other
 
| demospace = {{{demospace|}}} / main / talk / file / category / other
 
| type  = notice
 
| type  = notice
| image = [[File:Ambox Content.svg|40px]]
+
| image = [[File:Ambox important.svg|40px]]
 
| style=CSS values
 
| style=CSS values
 
| textstyle=CSS values
 
| textstyle=CSS values
Line 11: Line 11:
 
| plainlinks = no
 
| plainlinks = no
 
}}
 
}}
 +
 
== Usage ==
 
== Usage ==
* When the article title has "MS", but the labeltext has to show "M/V".
+
This template links to an unslashed target page <nowiki>[[</nowiki>{{nnbsp}}[[MS Antenor (1957)]]{{nnbsp}}]] and shows the slash: {{M/S|Antenor|1957}}
:Target: <nowiki>[[</nowiki>{{nnbsp}}[[MS Olau Hollandia (1981)]]{{nnbsp}}]]
+
 
:<code><nowiki>{{</nowiki>M/S|Olau Hollandia|1981}}</code> &rarr; {{M/S|Olau Hollandia|1981}}
+
* 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> &rarr; {{ship|S/Y|Manitou}}
+
:Use: <code><nowiki>{{</nowiki>ship|S/Y|Manitou}}</code> &rarr; {{ship|S/Y|Manitou}}
 +
=== 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.
 +
 
 +
=== Examples ===
 +
{|class=wikitable width="100%"
 +
|- style="background-color:#FCFCFC" align="left"
 +
! Template usage
 +
! Equivalent wikicode
 +
! Final result
 +
|-
 +
| <code><nowiki>{{M/S|Antenor|1957}}</nowiki></code>
 +
| <code><nowiki>[[MS Antenor (1957)|M/S ''Antenor'' (1957)]]</nowiki></code>
 +
| {{M/S|Antenor|1957}}
 +
|-
 +
| <code><nowiki>{{M/S|Queen Victoria|ship}}</nowiki></code>
 +
| <code><nowiki>[[MS Queen Victoria (ship)|M/S ''Queen Victoria'' (ship)]]</nowiki></code>
 +
| {{M/S|Queen Victoria|ship}}
 +
|-
 +
| <code><nowiki>{{M/S|Princess of Norway}}</nowiki></code>
 +
| <code><nowiki>[[MS Princess of Norway|M/S ''Princess of Norway'']]</nowiki></code>
 +
| {{M/S|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>{{M/S|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)|M/S ''Antenor'' (1957)]]</nowiki></code>, showing as:
 +
: {{nowrap|1={{M/S|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> &rarr;
 +
:<code><nowiki>[[MS Antenor (1957)|''Antenor'']]</nowiki></code> &rarr;
 +
:{{M/S|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>{{M/S|Antenor|1957}}</nowiki>
 +
| <nowiki>[[MS Antenor (1957)|M/S ''Antenor'' (1957)]]</nowiki>
 +
| {{M/S|Antenor|1957}}
 +
|-
 +
! 1
 +
| ''ID''
 +
| <nowiki>{{M/S|Antenor|1957|1}}</nowiki>
 +
| <nowiki>[[MS Antenor (1957)|''1957'']]</nowiki>
 +
| {{M/S|Antenor|1957|1}}
 +
|-
 +
! 2
 +
| ''name''
 +
| <nowiki>{{M/S|Antenor|1957|2}}</nowiki>
 +
| <nowiki>[[MS Antenor (1957)|''Antenor'']]</nowiki>
 +
| {{M/S|Antenor|1957|2}}
 +
|-
 +
! 3
 +
| ''name'' (ID)
 +
| <nowiki>{{M/S|Antenor|1957|3}}</nowiki>
 +
| <nowiki>[[MS Antenor (1957)|''Antenor'' (1957)]]</nowiki>
 +
| {{M/S|Antenor|1957|3}}
 +
|-
 +
! 4 {{nobold|1=<small>(dflt)</small>}}
 +
| PREFIX ''name'' (ID)
 +
| <nowiki>{{M/S|Antenor|1957|4}}</nowiki>
 +
| <nowiki>[[MS Antenor (1957)|M/S ''Antenor'' (1957)]]</nowiki>
 +
| {{M/S|Antenor|1957|4}}
 +
|-
 +
! 5
 +
| PREFIX ''ID''
 +
| <nowiki>{{M/S|Antenor|1957|5}}</nowiki>
 +
| <nowiki>[[MS Antenor (1957)|M/S ''1957'']]</nowiki>
 +
| {{M/S|Antenor|1957|5}}
 +
|-
 +
! 6
 +
| PREFIX ''name''
 +
| <nowiki>{{M/S|Antenor|1957|6}}</nowiki>
 +
| <nowiki>[[MS Antenor (1957)|M/S ''Antenor'']]</nowiki>
 +
| {{M/S|Antenor|1957|6}}
 +
|}
 +
:{{small|1=''Note'': options default (=blank), 2 and 6 are most often used.}}
 +
 
 +
== TemplateData ==
 +
{{Template:Ship/doc/fixed prefix: TemplateData}}
 +
 
 +
== See also ==
 +
{{WPSHIPS shortcut templates}}
  
==See also==
 
* {{tl|MS}}
 
* {{tl|Ship}}
 
 
<includeonly>{{sandbox other||
 
<includeonly>{{sandbox other||
<!-- {{Categories below this line, please; interwikis at Wikidata -->
 
 
[[Category:Ship prefix templates]]
 
[[Category:Ship prefix templates]]
 
 
}}</includeonly>
 
}}</includeonly>

Latest revision as of 20:52, 16 June 2020

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