[Edit] [ ] Template documentation
. (Edit | history)
Note to editors: Please don't categorize this template by editing it directly. Instead, place the category in its documentation page, in its "includeonly" section.
This template is used to represent an OpenStreetMap data key or key/value pair. Elements of the content are automatically linked to appropriate wiki pages.
The template can be used in a wide variety of ways. The simplest and most common usages are:
|A single key
|A specific key/value pair
|A key with a generic, literal value (not hyperlinked)
|A key with a description of value
Some key names can have multiple parts, often associated with key namespaces. One such example is keys associated with addresses: key addr:housenumber=* is used to specify a house number, addr:street=* is used to specify a name of a street, and so on. This template provides a choice of various approaches as to how the various parts of a multipart key are formatted: while the text itself remains the same, how the parts are linked differs.
- single link to subkey page
- This approach treats the compound key as a single entity, and links to the wiki page describing that compound key.
- produces a single link to the Key:building:fireproof wiki page, like so:
- This approach is most useful where a compound key is described on its own page, such as Key:building:fireproof or Key:addr:flats.
- single link to main key page: The following wikitext:
- produces a single link to the main Key:addr wiki page, like so:
- This approach is most useful where a collection of subkeys is described on the wiki page of the main key itself, such as Key:addr.
Some keys can have multiple values specified, with each separated by a semicolon. Up to two additional values may be specified with this template, like so:
Default target links to external sites for the values of specific keys
Some keys like wikipedia=*, wikidata=* or website=* may create external links, in that case their value in parameter 3 will be displayed (instead of just displaying an asterisk) along with their specific link according to their value; however when the value is the full URL of a website, unlike other tag values (that are generally short), that value is allowed to wrap when it is too long to fit on a line (this avoids making columns in feature tables to exceed a reasonnable maximum width).
Only a few keys recognize this feature:
For all other keys, the 3rd parameter is just displayed as is, without trying to convert them to new external links. This feature is also not used when the value is specified in the 2nd parameter (where it is used to generate internal links, if possible).
Linking to non-English pages
While the default action for the template is to link to English language pages, it is possible to specify that a different language be used. The kl parameter is used to specify the language of the target of the key link, and the vl to specify the language of the value link. In each case, a standard language code is used.
Where a key contains multiple parts which are linked separately, the kl: and kl:: parameters specify the language for the second and third links, respectively. Where a value contains multiple parts, the vl2 parameter specifies the language for the second link.
The following examples illustrates this.