Template:HMS
Usage[edit source]
This is a typing short cut for linking to Royal Navy ship articles named in the format "HMS Gloucester (D96)". Since Ship names are italicized in article text, and editors often don't want to include the pennant number, linking to them in the usual manner means typing everything twice, such as [[HMS Gloucester (D96)|HMS ''Gloucester'']]. This template halves that to {{HMS|Gloucester|D96|6}}.
Basic usage[edit source]
- {{HMS|Ship Name}}
- {{HMS|Ship Name|ID}}: the optional ID can be the hull number, pennant number or launch year as specified in the article title: [[HMA Ship Name (ID)]].
- {{HMS|Ship Name|ID|6}}: the last code (e.g., "6") sets the formatting of the blue link label.
- Examples
Template usage | Equivalent wikicode | Final result |
---|---|---|
{{HMS|Illustrious|R06}} | [[HMS Illustrious (R06)|HMS ''Illustrious'' (R06)]] | HMS Illustrious (R06) |
{{HMS|Raisonnable|1768}} | [[HMS Raisonnable (1768)|HMS ''Raisonnable'' (1768)]] | HMS Raisonnable (1768) |
{{HMS|Victory}} | [[HMS Victory|HMS ''Victory'']] | HMS Victory |
Last example could be used to link to ship index (disambiguation) page
Format options parameter[edit source]
A third, unnamed parameter |3=
allows setting which pieces of text are displayed in the wikilink. It sets the label in the link: [[targetpage|label]]
For example, the ship's article is entered as {{HMS|Illustrious|R06}}
, by default showing as HMS Illustrious (R06).
But in your article, the hull number (disambiguator) may not be needed to show. In that case, add |4=2
, and the result is:
{{HMS|Illustrious|R06|2}}
→ Illustrious[[HMS Illustrious (R06)|''Illustrious'']]
The options are:
Value | Displayed | Example | Wikicode | Showing | |
---|---|---|---|---|---|
None | prefix, name, ID | {{HMS|Illustrious|R06}} | [[HMS Illustrious (R06)|HMS ''Illustrious'' (R06)]] | HMS Illustrious (R06) | |
1 | ID | {{HMS|Illustrious|R06|1}} | [[HMS Illustrious (R06)|R06]] | R06 | |
2 | name | {{HMS|Illustrious|R06|2}} | [[HMS Illustrious (R06)|''Illustrious'']] | Illustrious | |
3 | name, ID | {{HMS|Illustrious|R06|3}} | [[HMS Illustrious (R06)|''Illustrious'' (R06)]] | Illustrious (R06) | |
4 | same as default | {{HMS|Illustrious|R06|4}} | [[HMS Illustrious (R06)|HMS ''Illustrious'' (R06)]] | HMS Illustrious (R06) | |
5 | prefix, ID | {{HMS|Illustrious|R06|5}} | [[HMS Illustrious (R06)|HMS ''R06'']] | HMS R06 | |
6 | prefix, name | {{HMS|Illustrious|R06|6}} | [[HMS Illustrious (R06)|HMS ''Illustrious'']] | HMS Illustrious |
See also[edit source]
External links[edit source]
- Template:HMS at Wikipedia, the free Terran-based encyclopedia that anyone can edit.
The above documentation is transcluded from Template:HMS/doc. (edit | history) 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. |