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

From blackwiki
< Template:M‎ | Y
Jump to navigation Jump to search
imported>DePiep
(Template:Ship prefix template (via WP:JWB))
 
imported>CommonsDelinker
(Replacing Ambox_Content.svg with File:Ambox_important.svg (by CommonsDelinker because: file renamed, redirect linked from other project).)
 
(5 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
| text  = 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 {{tlt|Ship}}.
+
| text  = 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 {{tlt|Ship}}.
 
| small =  
 
| small =  
 
| 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}}
+
This template links to an unslashed target page <nowiki>[[</nowiki>{{nnbsp}}[[MY Jairo Mora Sandoval]]{{nnbsp}}]], but it shows the slash: "M/Y": {{M/Y|Jairo Mora Sandoval|}}
  
 
== Usage ==
 
== Usage ==
* To show "MS" (unslashed), use {{tl|MS}}: {{MS|Antenor|1957}}
+
* To show "MY" (unslashed), use {{tl|MY}}: {{MY|Jairo Mora Sandoval|}}
  
 
* When the target pagename has a "/" slash, use {{tl|Ship}}:
 
* When the target pagename has a "/" slash, use {{tl|Ship}}:
Line 21: Line 21:
  
 
== Usage ==
 
== 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}}.
+
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 <nowiki>[[MY Shipname (ID)|M/Y ''Shipname'' (ID)]]</nowiki>.  This template halves that to <nowiki>{{M/Y|Shipname|ID}}.
 
</nowiki>
 
</nowiki>
  
 
=== Formal Usage ===
 
=== Formal Usage ===
  
* <code><nowiki>{{M/S|Ship Name}}</nowiki></code>
+
* <code><nowiki>{{M/Y|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.
+
* <code><nowiki>{{M/Y|Ship Name|ID}}</nowiki></code>, where ID can be the [[hull number]], launch year, or [[pennant number]], as specified in the article title.
  
 
=== Examples ===
 
=== Examples ===
Line 36: Line 36:
 
  ! Final result
 
  ! Final result
 
  |-
 
  |-
  | <tt><nowiki>{{M/S|Antenor|1957}}</nowiki></tt>
+
  | <code><nowiki>{{M/Y|Jairo Mora Sandoval|}}</nowiki></code>
  | <tt><nowiki>[[MS Antenor (1957)|M/S ''Antenor'' (1957)]]</nowiki></tt>
+
  | <code><nowiki>[[MY Jairo Mora Sandoval ()|M/Y ''Jairo Mora Sandoval'' ()]]</nowiki></code>
  | {{M/S|Antenor|1957}}
+
  | {{M/Y|Jairo Mora Sandoval|}}
 
  |-
 
  |-
  | <tt><nowiki>{{M/S|Queen Victoria|ship}}</nowiki></tt>
+
  | <code><nowiki>{{M/Y|Queen Victoria|ship}}</nowiki></code>
  | <tt><nowiki>[[MS Queen Victoria (ship)|M/S ''Queen Victoria'' (ship)]]</nowiki></tt>  
+
  | <code><nowiki>[[MY Queen Victoria (ship)|M/Y ''Queen Victoria'' (ship)]]</nowiki></code>  
  | {{M/S|Queen Victoria|ship}}
+
  | {{M/Y|Queen Victoria|ship}}
 
  |-
 
  |-
  | <tt><nowiki>{{M/S|Princess of Norway}}</nowiki></tt>
+
  | <code><nowiki>{{M/Y|Princess of Norway}}</nowiki></code>
  | <tt><nowiki>[[MS Princess of Norway|M/S ''Princess of Norway'']]</nowiki></tt>
+
  | <code><nowiki>[[MY Princess of Norway|M/Y ''Princess of Norway'']]</nowiki></code>
  | {{M/S|Princess of Norway}}
+
  | {{M/Y|Princess of Norway}}
 
  |}
 
  |}
  
 
==Label format options==
 
==Label format options==
* To show "M/S", use {{tl|M/S}}: {{M/S|Antenor|1957}}
+
* To show "M/Y", use {{tl|M/Y}}: {{M/Y|Jairo Mora Sandoval|}}
 
* To link to [[S/Y Manitou]], use <nowiki>{{Ship|S/Y|Manitou}}</nowiki>
 
* To link to [[S/Y Manitou]], use <nowiki>{{Ship|S/Y|Manitou}}</nowiki>
  
 
By default, the wikilink is build like this:
 
By default, the wikilink is build like this:
* <code><nowiki>{{M/S|Antenor|1957}}</nowiki></code>, the targetpage is
+
* <code><nowiki>{{M/Y|Jairo Mora Sandoval|}}</nowiki></code>, the targetpage is
: {{nowrap|1=<code><nowiki>[[MS Antenor (1957)]]</nowiki></code>}}.
+
: {{nowrap|1=<code><nowiki>[[MY Jairo Mora Sandoval]]</nowiki></code>}}.
 
:Then the template by default adds the formatted label:
 
:Then the template by default adds the formatted label:
 
:<code><nowiki>[[targetpage|label]]</nowiki></code>
 
:<code><nowiki>[[targetpage|label]]</nowiki></code>
:<code><nowiki>[[MS Antenor (1957)|M/S ''Antenor'' (1957)]]</nowiki></code>, showing as:
+
:<code><nowiki>[[MY Jairo Mora Sandoval ()|M/Y ''Jairo Mora Sandoval'' ()]]</nowiki></code>, showing as:
: {{nowrap|1={{M/S|Antenor|1957}}}}.
+
: {{nowrap|1={{M/Y|Jairo Mora Sandoval|}}}}.
  
 
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:  
 
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:
 
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>{{</nowiki>MY|Jairo Mora Sandoval|<span style="background:yellow;">|2</span>}}</code> &rarr;
:<code><nowiki>[[MS Antenor (1957)|''Antenor'']]</nowiki></code> &rarr;
+
:<code><nowiki>[[MY Jairo Mora Sandoval ()|''Jairo Mora Sandoval'']]</nowiki></code> &rarr;
:{{M/S|Antenor|1957|2}}
+
:{{M/Y|Jairo Mora Sandoval||2}}
  
 
The options are:
 
The options are:
Line 77: Line 77:
 
! {{nobold|1=(default)}}
 
! {{nobold|1=(default)}}
 
| PREFIX ''name'' (ID)
 
| PREFIX ''name'' (ID)
| <nowiki>{{M/S|Antenor|1957}}</nowiki>
+
| <nowiki>{{M/Y|Jairo Mora Sandoval|}}</nowiki>
| <nowiki>[[MS Antenor (1957)|M/S ''Antenor'' (1957)]]</nowiki>
+
| <nowiki>[[MY Jairo Mora Sandoval ()|M/Y ''Jairo Mora Sandoval'' ()]]</nowiki>
| {{M/S|Antenor|1957}}
+
| {{M/Y|Jairo Mora Sandoval|}}
 
|-
 
|-
 
! 1
 
! 1
 
| ''ID''
 
| ''ID''
| <nowiki>{{M/S|Antenor|1957|1}}</nowiki>
+
| <nowiki>{{M/Y|Jairo Mora Sandoval||1}}</nowiki>
| <nowiki>[[MS Antenor (1957)|''1957'']]</nowiki>
+
| <nowiki>[[MY Jairo Mora Sandoval ()|'''']]</nowiki>
| {{M/S|Antenor|1957|1}}
+
| {{M/Y|Jairo Mora Sandoval||1}}
 
|-
 
|-
 
! 2
 
! 2
 
| ''name''
 
| ''name''
| <nowiki>{{M/S|Antenor|1957|2}}</nowiki>
+
| <nowiki>{{M/Y|Jairo Mora Sandoval||2}}</nowiki>
| <nowiki>[[MS Antenor (1957)|''Antenor'']]</nowiki>
+
| <nowiki>[[MY Jairo Mora Sandoval ()|''Jairo Mora Sandoval'']]</nowiki>
| {{M/S|Antenor|1957|2}}
+
| {{M/Y|Jairo Mora Sandoval||2}}
 
|-
 
|-
 
! 3
 
! 3
 
| ''name'' (ID)
 
| ''name'' (ID)
| <nowiki>{{M/S|Antenor|1957|3}}</nowiki>
+
| <nowiki>{{M/Y|Jairo Mora Sandoval||3}}</nowiki>
| <nowiki>[[MS Antenor (1957)|''Antenor'' (1957)]]</nowiki>
+
| <nowiki>[[MY Jairo Mora Sandoval ()|''Jairo Mora Sandoval'' ()]]</nowiki>
| {{M/S|Antenor|1957|3}}
+
| {{M/Y|Jairo Mora Sandoval||3}}
 
|-
 
|-
 
! 4 {{nobold|1=<small>(dflt)</small>}}
 
! 4 {{nobold|1=<small>(dflt)</small>}}
 
| PREFIX ''name'' (ID)
 
| PREFIX ''name'' (ID)
| <nowiki>{{M/S|Antenor|1957|4}}</nowiki>
+
| <nowiki>{{M/Y|Jairo Mora Sandoval||4}}</nowiki>
| <nowiki>[[MS Antenor (1957)|M/S ''Antenor'' (1957)]]</nowiki>
+
| <nowiki>[[MY Jairo Mora Sandoval ()|M/Y ''Jairo Mora Sandoval'' ()]]</nowiki>
| {{M/S|Antenor|1957|4}}
+
| {{M/Y|Jairo Mora Sandoval||4}}
 
|-
 
|-
 
! 5
 
! 5
 
| PREFIX ''ID''
 
| PREFIX ''ID''
| <nowiki>{{M/S|Antenor|1957|5}}</nowiki>
+
| <nowiki>{{M/Y|Jairo Mora Sandoval||5}}</nowiki>
| <nowiki>[[MS Antenor (1957)|M/S ''1957'']]</nowiki>
+
| <nowiki>[[MY Jairo Mora Sandoval ()|M/Y '''']]</nowiki>
| {{M/S|Antenor|1957|5}}
+
| {{M/Y|Jairo Mora Sandoval||5}}
 
|-
 
|-
 
! 6
 
! 6
 
| PREFIX ''name''
 
| PREFIX ''name''
| <nowiki>{{M/S|Antenor|1957|6}}</nowiki>
+
| <nowiki>{{M/Y|Jairo Mora Sandoval||6}}</nowiki>
| <nowiki>[[MS Antenor (1957)|M/S ''Antenor'']]</nowiki>
+
| <nowiki>[[MY Jairo Mora Sandoval ()|M/Y ''Jairo Mora Sandoval'']]</nowiki>
| {{M/S|Antenor|1957|6}}
+
| {{M/Y|Jairo Mora Sandoval||6}}
 
|}
 
|}
 
:{{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 ==

Latest revision as of 21:29, 16 June 2020

This template links to an unslashed target page [[Template:NnbspMY Jairo Mora SandovalTemplate:Nnbsp]], but it shows the slash: "M/Y": Template:Ship/special

Usage

  • 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

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