Template:Infobox road/doc/tech

Various technical notes related to Infobox road (IBR) that are either too obscure or too advanced for the average editor.

Countries

{{see also|Template:Infobox road/doc/country}}

The "country", "state", and "province" parameters are all fed into {{tl|Infobox road/meta/mask/country}}, a mask that determines what country is needed. If a country is added that has states, provinces, or an equivalent subdivision, the mask template will need to be updated accordingly; otherwise, it will not output the correct country and the infobox will not use the correct templates. If both "country" and "state"/"province" are specified, the country takes precedence.

Every transclusion that uses the "type" parameter must use either "country", "state", or "province" as well. As an example, all U.S. Highway and Interstate Highway articles must have "country=USA" if they don't have "state=". Articles that use "type" without using "country", "state", or "province" will not display correctly and are categorized in :Category:Infobox road transclusion errors.

General notes

"spur_type" must be added to all articles that use "spur_of"; else, the parameter will not work.

For special routes, it is necessary to input the main route type and the special route type separately using "type" and "subtype", which is identical to how {{tl|Infobox road small}} accepts special routes. This allows {{tl|infobox road/banner}} to generate the correct banner and alt text for the route. It also eliminates the need for switches covering different capitalizations (BUS vs. Bus vs. bus) since the infobox uses a mask ({{tl|infobox road/meta/mask/subtype1}}) to standardize the subtype input before it gets passed into the /country template.

Meta templates

IBR has several templates that are used by several countries (hence the "meta" in their name). They are:

  • Template:Infobox road/meta/colors – controls the color of the infobox's headers
  • Template:Infobox road/meta/errors – adds articles using regionally invalid location parameters to :Category:Infobox road transclusion errors
  • Template:Infobox road/meta/length – calculates the conversion (miles to kilometers or kilometers to miles) of whichever length is specified
  • Template:Infobox road/meta/mask/category – sorts each instance into a category based on which country, state, province in which the route is
  • Template:Infobox road/meta/mask/country – a mask that determines which country a state or province in which the route is
  • Template:Infobox road/meta/mask/subtype1 – see "General notes" above
  • Template:Infobox road/meta/mask/subtype2 – a mask that takes the output of subtype1 and outputs the full name of the subtype ("Alt" becomes "Alternate", for example)
  • Template:Infobox road/meta/spur of – controls the output of the spur_of line in the "Route information" section
  • Location

    This template has nine location parameters and one route information parameter that are restricted to use in only certain regions or countries. The restriction is handled by subtemplates of "Template:Infobox road/hide/", which processes the given country, state, or province and determines whether the parameter is cleared for use there. If it is not, the article is placed in :Category:Infobox road transclusion errors. All of these subtemplates are fully protected per WP:HRT.

    class="wikitable"

    ! Parameter !! Template

    cities
    towns
    villages
    Template:Infobox road/hide/cities
    countriesTemplate:Infobox road/hide/countries
    destinationsTemplate:Infobox road/hide/destinations
    provincesTemplate:Infobox road/hide/provinces
    regionsTemplate:Infobox road/hide/regions
    rural_municipalitiesTemplate:Infobox road/hide/ruralmuni
    statesTemplate:Infobox road/hide/states
    touristTemplate:Infobox road/hide/tourist

    Tracking categories

    class="wikitable"

    ! Category !! What it tracks

    | {{clc|Pages using infobox road with unknown parameters}}

    transclusions using unsupported parameters
    {{clc|Infobox road transclusion errors}}see category description
    {{clc|Infobox road temporary tracking category 1}}see category description
    {{clc|Infobox road maps for Wikidata migration}}rowspan=4 | Data specified on or missing from Wikidata items

    | {{clc|Infobox road articles without Wikidata country}}

    {{clc|Infobox road articles without Wikidata instance of}}