Difference between revisions of "Template:Airreg/doc"

From blackwiki
Jump to navigation Jump to search
blackwiki>Deeday-UK
(+ CF switch case for Canadian 'vintage aircraft')
blackwiki>Deeday-UK
(+ note on NC, NX etc. regs)
Line 9: Line 9:
 
{{Reflist-talk}}
 
{{Reflist-talk}}
  
Only a limited number of national registries are supported, i.e. those whose websites allow registration-based searches via URL parameters ([[HTTP GET]] requests).
+
Only a limited number of national registries are supported (see below), i.e. those whose websites allow registration-based searches via URL parameters ([[HTTP GET]] requests).
  
 
'''Editors beware:''' formatting of code to make it "look nice" is likely to inadvertently introduce leading and trailing blank lines into the template output.
 
'''Editors beware:''' formatting of code to make it "look nice" is likely to inadvertently introduce leading and trailing blank lines into the template output.
Line 21: Line 21:
 
# Punctuation (optional)
 
# Punctuation (optional)
  
The prefix can be any of the [[Aircraft registration#List of countries/regions and their registration prefixes and patterns|ICAO country prefixes]], although only for supported countries (see below) a footnote reference will be generated. For non-supported countries, the template simply outputs the registration in full, e.g.  <code><nowiki>{{Airreg|TZ|AMK}}</nowiki></code> produces
+
The prefix can be any of the [[Aircraft registration#List of countries/regions and their registration prefixes and patterns|ICAO country prefixes]], although only for supported countries a footnote reference will be generated. For non-supported countries, the template simply outputs the registration in full, e.g.  <code><nowiki>{{Airreg|TZ|AMK}}</nowiki></code> produces
 
{{Airreg|TZ|AMK}}
 
{{Airreg|TZ|AMK}}
  
Line 38: Line 38:
 
G  United Kingdom
 
G  United Kingdom
 
HB  Switzerland
 
HB  Switzerland
N  United States
+
N  United States (pre-1949 registrations: NC, NX etc. are not supported)
 
OY  Denmark
 
OY  Denmark
 
PH  Netherlands
 
PH  Netherlands

Revision as of 15:11, 22 May 2015

The Airreg template can be used to generate footnote references to entries in aviation authority registries for the desired aircraft registration; for example: {{Airreg|N|470A}} produces:

N470A[1]

Template:Reflist-talk

Only a limited number of national registries are supported (see below), i.e. those whose websites allow registration-based searches via URL parameters (HTTP GET requests).

Editors beware: formatting of code to make it "look nice" is likely to inadvertently introduce leading and trailing blank lines into the template output.

Usage

The template takes three positional parameters:

  1. Country prefix
  2. Registration string
  3. Punctuation (optional)

The prefix can be any of the ICAO country prefixes, although only for supported countries a footnote reference will be generated. For non-supported countries, the template simply outputs the registration in full, e.g. {{Airreg|TZ|AMK}} produces TZ-AMK

Any punctuation that is required to be placed before the citation marker (per WP:PAIC) can be specified as third parameter, e.g. {{Airreg|N|470A|,}} produces:

N470A,[2]

Template:Reflist-talk

Country prefixes supported

    _
C    |
CF  _> Canada

G   United Kingdom
HB  Switzerland
N   United States (pre-1949 registrations: NC, NX etc. are not supported)
OY  Denmark
PH  Netherlands
    _
PP   |
PR   |
PS    > Brazil
PT   |
PU  _|

VH  Australia
ZK  New Zealand

Note: South Korea (HL) and Japan (JA) are not supported, but are listed in the code among the supported prefixes, in order for the complete registration to be correctly outputted without a hyphen, unlike the default case that covers all other non-supported nations.


  1. "FAA Registry (N470A)". Federal Aviation Administration.
  2. "FAA Registry (N470A)". Federal Aviation Administration.