Template:Seiner Majestät Unterseeboot
| This template is used on approximately 2,500 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
Usage
This template produces a wikilink to an Imperial German Navy or Austro-Hungarian Navy submarine article named in the format "SM U-28 (Germany)". Because ship names are italicized in article text, linking to them without a template necessitates typing everything twice, such as [[SM U-28 (Germany)|SM ''U-28'' (Germany)]]. This template shortens that to {{SMU|U-28|Germany}}.
The ship prefix SMU or SM U stands for Seiner Majestät Unterseeboot. (Ship prefixes are rarely written out.)
(Seiner Majestäts Unterseeboot is an incorrect attempt at updating the archaic prefix, which is already possessive.)
Formal usage
{{SMU|Ship Name}}{{SMU|Ship Name|disambig}}, wheredisambigis usually either Germany, or Austria-Hungary
Examples
| Template usage | Equivalent wikicode | Final result |
|---|---|---|
{{SMU|U-28|Germany}} |
[[SM U-28 (Germany)|SM ''U-28'' (Germany)]] |
SM U-28 (Germany) |
{{SMU|U-28}} |
[[SM U-28|SM ''U-28'']] |
SM U-28 |
The last example could link to an unambiguous ship page or a ship index (disambiguation) page. (SM U-28 is a disambiguation page.)
Optional display control parameter
An optional 3rd parameter controls which pieces of text are displayed in the article. (All parameters are used to build the link.)
Its value is treated as a binary number and its "bits" decide what will display. Setting the "4" bit displays "SM"; setting the "2" bit displays the ship name, and setting the "1" bit displays the ID. If binary math isn't your thing, refer to these examples:
| Value | Parameter(s) displayed |
Example | Equivalent wikicode | Final result |
|---|---|---|---|---|
| None | all | {{SMU|U-28|Germany}} |
[[SM U-28 (Germany)|SM ''U-28'' (Germany)]] |
SM U-28 (Germany) |
| 1 | 2nd | {{SMU|U-28|Germany|1}} |
[[SM U-28 (Germany)|Germany]] |
Germany |
| 2 | 1st | {{SMU|U-28|Germany|2}} |
[[SM U-28 (Germany)|''U-28'']] |
U-28 |
| 3 | 1st, 2nd | {{SMU|U-28|Germany|3}} |
[[SM U-28 (Germany)|''U-28'' (Germany)]] |
U-28 (Germany) |
| 4 | invalid result | {{SMU|U-28|Germany|4}} |
N/a | Error: {{SMU}} invalid control parameter: 4 (help) |
| 5 | "SM", 2nd | {{SMU|U-28|Germany|5}} |
[[SM U-28 (Germany)|SM (Germany)]] |
SM Germany |
| 6 | "SM", 1st | {{SMU|U-28|Germany|6}} |
[[SM U-28 (Germany)|SM ''U-28'']] |
SM U-28 |
| 2 | 1st (no 2nd) |
{{SMU|U-103|3=2}}alternate usage: {{SMU|U-103||2}} |
[[SM U-103|''U-103'']] |
U-103 |
These are the same optional parameters in use in the other ship shortcut templates. Some of the options above are not useful in the case of World War I-era U-boats, but are included for compatibility with other shortcut templates.
N.B.: Be careful with the 2nd parameter if not using the 1st parameter. In the U-103 example above, the "|3=2" sets the 3rd parameter to the value 2. In the "alternate usage" example, "||2", uses a pair of pipes to place the value 2 as the third parameter.
TemplateData
TemplateData | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Seiner Majestät Unterseeboot in articles based on its TemplateData.
TemplateData for Seiner Majestät Unterseeboot This template provides a wikilink to a ship's page, with label options
| |||||||||||||||||||||||||