Difference between revisions of "Template:Infobox road/doc/tech"

From blackwiki
Jump to navigation Jump to search
imported>WOSlinker
(→‎Browsing: update)
imported>Fredddie
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
Various technical notes related to Infobox road (IBR) that are either too obscure or too advanced for the average editor.
 
Various technical notes related to Infobox road (IBR) that are either too obscure or too advanced for the average editor.
  
==IBR/country==
+
==Countries==
 
{{see also|Template:Infobox road/doc/country}}
 
{{see also|Template:Infobox road/doc/country}}
The "country", "state", and "province" parameters are all fed into {{tl|Infobox road/country}}, a "master" template that determines what country is needed through {{tl|Infobox road/meta/mask/country}}. 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.
+
The "country", "state", and "province" parameters are all fed into {{tl|Infobox road/meta/mask/country}}, a [[mask (computing)|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.
 
 
Aside from determining which country is appropriate, the country subtemplate also calls /''cat''/''country'', where "cat" is passed in through Infobox road itself and currently includes:
 
*"shieldmain" for the lead shield in the infobox
 
*"name" for the name below it
 
*"maint" for specifying a default maintenance agency for a jurisdiction
 
*"browselinks" for the links at the bottom of the infobox
 
*"browse" for the browse rows.
 
  
 
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]].
 
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]].
  
 
==Browsing==
 
==Browsing==
All countries use the same code base ({{tl|Infobox road/meta/browse}}) for the actual browsing.
+
All countries use the same code base ({{tl|Infobox road/meta/browse}}) for the actual browsing. The size of the shields in the browse rows is adjustable and is handled by {{tl|Infobox road/meta/browse/size}}. This template uses a series of switches that allows for the size to be set by country, state/province, or even by type.
 
 
The size of the shields in the browse rows is adjustable and is handled by {{tl|Infobox road/meta/browse/size}}. This template uses a series of switches that allows for the size to be set by country, state/province, or even by type.
 
  
 
==General notes==
 
==General notes==
Line 30: Line 21:
 
**[[Template:Infobox road/meta/browse/size]] – see "Browsing" above
 
**[[Template:Infobox road/meta/browse/size]] – see "Browsing" above
 
*[[Template:Infobox road/meta/colors]] – controls the color of the infobox's headers
 
*[[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/length]] – calculates the conversion (miles to kilometers or kilometers to miles) of whichever length is specified
**[[Template:Infobox road/meta/length/km]] – the multiplier used to convert kilometers to miles
+
*[[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/length/mi]] – the multiplier used to convert miles to kilometers
+
*[[Template:Infobox road/meta/mask/country]] – a [[mask (computing)|mask]] that determines which country a state or province in which the route is
*[[Template:Infobox road/meta/mask/country]] – a [[mask (computing)|mask]] that determines which country a state or province is in
 
 
*[[Template:Infobox road/meta/mask/subtype1]] – see "General notes" above
 
*[[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/mask/subtype2]] – a mask that takes the output of subtype1 and outputs the full name of the subtype ("Alt" becomes "Alternate", for example)
Line 39: Line 30:
  
 
==Location==
 
==Location==
This template has seven location parameters 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 transclusions with locally invalid parameters]]. All of these subtemplates are fully protected per [[WP:HRT]].
+
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"
 
{| class="wikitable"
 
! Parameter !! Template
 
! Parameter !! Template
 +
|-
 +
|'''cities'''<br>'''towns'''<br>'''villages''' || [[Template:Infobox road/hide/cities]]
 
|-
 
|-
 
|'''countries''' || [[Template:Infobox road/hide/countries]]
 
|'''countries''' || [[Template:Infobox road/hide/countries]]
 
|-
 
|-
|'''regions''' || [[Template:Infobox road/hide/regions]]
+
|'''destinations''' || [[Template:Infobox road/hide/destinations]]
 
|-
 
|-
 
|'''provinces''' || [[Template:Infobox road/hide/provinces]]
 
|'''provinces''' || [[Template:Infobox road/hide/provinces]]
 +
|-
 +
|'''regions''' || [[Template:Infobox road/hide/regions]]
 
|-
 
|-
 
|'''rural_municipalities''' || [[Template:Infobox road/hide/ruralmuni]]
 
|'''rural_municipalities''' || [[Template:Infobox road/hide/ruralmuni]]
 
|-
 
|-
|'''cities'''<br>'''towns'''<br>'''villages''' || [[Template:Infobox road/hide/cities]]
+
|'''states''' || [[Template:Infobox road/hide/states]]
 +
|-
 +
|'''tourist''' || [[Template:Infobox road/hide/tourist]]
 
|}
 
|}
  
Line 59: Line 56:
 
! Category !! What it tracks
 
! Category !! What it tracks
 
|-
 
|-
|[[:Category:Infobox road transclusions with deprecated parameters]] || ''nothing at the moment''
+
| {{clc|Infobox road transclusions with deprecated parameters}} || ''nothing at the moment''
 +
|-
 +
| {{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 with wikidata logo image}}
 
|-
 
|-
|[[:Category:Infobox road transclusion errors]] ||
+
| {{clc|Infobox road articles without wikidata country}}
*Articles with a valid location (country, state, or province) but with an invalid or unlisted type, either in the main type or in the browse
 
*Articles that are lacking a location (country, state, or province) but have a type specified
 
*Articles that have "spur_of" specified without also specifying "spur_type"
 
 
|-
 
|-
|[[:Category:Infobox road transclusions with locally invalid parameters]] || articles using a restricted location parameter
+
| {{clc|Infobox road articles without wikidata instance of}}
 
|}
 
|}

Latest revision as of 01:16, 28 February 2020

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

Countries

The "country", "state", and "province" parameters are all fed into {{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.

Browsing

All countries use the same code base ({{Infobox road/meta/browse}}) for the actual browsing. The size of the shields in the browse rows is adjustable and is handled by {{Infobox road/meta/browse/size}}. This template uses a series of switches that allows for the size to be set by country, state/province, or even by type.

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 {{Infobox road small}} accepts special routes. This allows {{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 ({{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:

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.

Parameter Template
cities
towns
villages
Template:Infobox road/hide/cities
countries Template:Infobox road/hide/countries
destinations Template:Infobox road/hide/destinations
provinces Template:Infobox road/hide/provinces
regions Template:Infobox road/hide/regions
rural_municipalities Template:Infobox road/hide/ruralmuni
states Template:Infobox road/hide/states
tourist Template:Infobox road/hide/tourist

Tracking categories

Category What it tracks
Category:Infobox road transclusions with deprecated parameters (0) nothing at the moment
Category:Pages using infobox road with unknown parameters (0) transclusions using unsupported parameters
Category:Infobox road transclusion errors (0) see category description
Category:Infobox road temporary tracking category 1 (0) see category description
Category:Infobox road maps for Wikidata migration (0) Data specified on or missing from Wikidata items
Category:Infobox road articles with wikidata logo image (0)
Category:Infobox road articles without wikidata country (0)
Category:Infobox road articles without wikidata instance of (0)