Difference between revisions of "Template:HMS/doc"
imported>Swpb m (→See also: clean up using AWB) |
imported>DePiep |
||
| Line 32: | Line 32: | ||
Last example could be used to link to ship index (disambiguation) page | Last example could be used to link to ship index (disambiguation) page | ||
| − | === | + | === Format options parameter === |
| − | + | A fourth, unnamed parameter {{para|4}} allows setting which pieces of text are displayed in the wikilink. It sets the ''label'' in the link: <code><nowiki>[[targetpage|label]]</nowiki></code> | |
| − | {|class=wikitable width= | + | |
| + | For example, the ship's article is entered as <code><nowiki>{{ship|HMS|Illustrious|R06}}</nowiki></code>, by default showing as {{ship|HMS|Illustrious|R06}}. | ||
| + | |||
| + | But in your article, the hull number (disambiguator) may not be needed to show. In that case, add {{para|4|2}}, and the result is: | ||
| + | :<code><nowiki>{{ship</nowiki>|HMS|Illustrious|R06<span style="background:yellow;">|2</span>}} <code><nowiki>[[HMS Illustrious (R06)|''Illustrious'']]</nowiki></code> </code> → {{ship|HMS|Illustrious|R06|2}} | ||
| + | |||
| + | The options are: | ||
| + | {|class=wikitable width=100% | ||
! Value | ! Value | ||
! Parameter(s)<br>displayed | ! Parameter(s)<br>displayed | ||
| Line 40: | Line 47: | ||
! Equivalent wikicode | ! Equivalent wikicode | ||
! Final result | ! Final result | ||
| + | |-same as default | ||
| + | ! None | ||
| + | | style="text-align:center;" | prefix, name, ID | ||
| + | | colspan=2 | <nowiki>{{ship|HMS|Illustrious|R06}}</nowiki> | ||
| + | | <nowiki>[[HMS Illustrious (R06)|HMS ''Illustrious'' (R06)]]</nowiki> | ||
| + | | {{ship|HMS|Illustrious|R06}} | ||
|- | |- | ||
! 1 | ! 1 | ||
| − | | style="text-align:center;" | | + | | style="text-align:center;" | ID |
| − | | colspan=2 | <nowiki>{{HMS|Illustrious|R06|1}}</nowiki> | + | | colspan=2 | <nowiki>{{ship|HMS|Illustrious|R06|1}}</nowiki> |
| <nowiki>[[HMS Illustrious (R06)|R06]]</nowiki> | | <nowiki>[[HMS Illustrious (R06)|R06]]</nowiki> | ||
| − | | {{HMS|Illustrious|R06|1}} | + | | {{ship|HMS|Illustrious|R06|1}} |
|- | |- | ||
! 2 | ! 2 | ||
| − | | style="text-align:center;" | | + | | style="text-align:center;" | name |
| − | | colspan=2 | <nowiki>{{HMS|Illustrious|R06|2}</nowiki> | + | | colspan=2 | <nowiki>{{ship|HMS|Illustrious|R06|2}}</nowiki> |
| − | | <nowiki>[[HMS Illustrious (R06)|''Illustrious'']]</nowiki> | + | | <nowiki>[[HMS Illustrious (R06)|''Illustrious'']]</nowiki> |
| − | | {{HMS|Illustrious|R06|2}} | + | | {{ship|HMS|Illustrious|R06|2}} |
|- | |- | ||
! 3 | ! 3 | ||
| − | | style="text-align:center;" | | + | | style="text-align:center;" | name, ID |
| − | | colspan=2 | <nowiki>{{HMS|Illustrious|R06|3}}</nowiki> | + | | colspan=2 | <nowiki>{{ship|HMS|Illustrious|R06|3}}</nowiki> |
| − | | <nowiki>[[HMS Illustrious (R06)|''Illustrious'' R06]]</nowiki> | + | | <nowiki>[[HMS Illustrious (R06)|''Illustrious'' (R06)]]</nowiki> |
| − | | {{HMS|Illustrious|R06|3}} | + | | {{ship|HMS|Illustrious|R06|3}} |
|- | |- | ||
! 4 | ! 4 | ||
| − | | style="text-align:center;" | | + | | style="text-align:center;" | ''same as default'' |
| − | | colspan=2 | <nowiki>{{HMS|Illustrious|R06|4}}</nowiki> | + | | colspan=2 | <nowiki>{{ship|HMS|Illustrious|R06|4}}</nowiki> |
| − | | <nowiki>[[HMS Illustrious (R06)| | + | | <nowiki>[[HMS Illustrious (R06)|HMS ''Illustrious'' (R06)]]</nowiki> |
| − | | {{HMS|Illustrious|R06|4}} | + | | {{ship|HMS|Illustrious|R06|4}} |
|- | |- | ||
! 5 | ! 5 | ||
| − | | style="text-align:center;" | | + | | style="text-align:center;" | prefix, ID |
| − | | colspan=2 | <nowiki>{{HMS|Illustrious|R06|5}}</nowiki> | + | | colspan=2 | <nowiki>{{ship|HMS|Illustrious|R06|5}}</nowiki> |
| − | | <nowiki>[[HMS Illustrious (R06)|HMS R06]]</nowiki> | + | | <nowiki>[[HMS Illustrious (R06)|HMS ''R06'']]</nowiki> |
| − | | {{HMS|Illustrious|R06|5}} | + | | {{ship|HMS|Illustrious|R06|5}} |
|- | |- | ||
! 6 | ! 6 | ||
| − | | style="text-align:center;" | | + | | style="text-align:center;" | prefix, name |
| − | | colspan=2 | <nowiki>{{HMS|Illustrious|R06|6}}</nowiki> | + | | colspan=2 | <nowiki>{{ship|HMS|Illustrious|R06|6}}</nowiki> |
| <nowiki>[[HMS Illustrious (R06)|HMS ''Illustrious'']]</nowiki> | | <nowiki>[[HMS Illustrious (R06)|HMS ''Illustrious'']]</nowiki> | ||
| − | | {{HMS|Illustrious|R06|6}} | + | | {{ship|HMS|Illustrious|R06|6}} |
| − | | | + | |} |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
==TemplataData section== | ==TemplataData section== | ||
Revision as of 01:54, 11 March 2018
| 40px | This is a documentation subpage for Template:HMS. It contains usage information, categories and other content that is not part of the original template page. |
Contents
Usage
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}}.
Formal usage
- {{HMS|Ship Name}}
- {{HMS|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 |
|---|---|---|
| {{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
A fourth, unnamed parameter |4= 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 {{ship|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:
{{ship|HMS|Illustrious|R06|2}}→ Illustrious[[HMS Illustrious (R06)|''Illustrious'']]
The options are:
| Value | Parameter(s) displayed |
Example | Equivalent wikicode | Final result | |
|---|---|---|---|---|---|
| None | prefix, name, ID | {{ship|HMS|Illustrious|R06}} | [[HMS Illustrious (R06)|HMS ''Illustrious'' (R06)]] | HMS Illustrious (R06) | |
| 1 | ID | {{ship|HMS|Illustrious|R06|1}} | [[HMS Illustrious (R06)|R06]] | R06 | |
| 2 | name | {{ship|HMS|Illustrious|R06|2}} | [[HMS Illustrious (R06)|''Illustrious'']] | Illustrious | |
| 3 | name, ID | {{ship|HMS|Illustrious|R06|3}} | [[HMS Illustrious (R06)|''Illustrious'' (R06)]] | Illustrious (R06) | |
| 4 | same as default | {{ship|HMS|Illustrious|R06|4}} | [[HMS Illustrious (R06)|HMS ''Illustrious'' (R06)]] | HMS Illustrious (R06) | |
| 5 | prefix, ID | {{ship|HMS|Illustrious|R06|5}} | [[HMS Illustrious (R06)|HMS ''R06'']] | HMS R06 | |
| 6 | prefix, name | {{ship|HMS|Illustrious|R06|6}} | [[HMS Illustrious (R06)|HMS ''Illustrious'']] | HMS Illustrious | |
TemplataData section
Syntax error in JSON.
See also
Template:WPSHIPS shortcut templates