Template:TagValue: Difference between revisions
Minh Nguyen (talk | contribs) (Synchronized w/ Template:TagValue/sandbox (2694662): migrated to Module:Tag) Tag: Replaced |
Minh Nguyen (talk | contribs) (Replaced placeholders w/ more obviously fake placeholders per Template talk:Tag#First line) |
||
Line 1: | Line 1: | ||
<tt style="background:#EEF;font-size:1em;line-height:1.6">{{#invoke:tag|value<noinclude>| |
<tt style="background:#EEF;font-size:1em;line-height:1.6">{{#invoke:tag|value<noinclude>|key||value</noinclude>}}</tt><noinclude>{{Documentation}}</noinclude> |
Latest revision as of 20:14, 2 July 2024
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 has a sandbox (Edit) for editors to experiment.
Displays a tag: key-value and (optionally) links to the corresponding wiki page.
This template is powered by Module:Tag.
Traditional format
Usage:
{{TagValue|key}}
{{TagValue|key|value}}
{{TagValue|key|value linked|value displayed}}
{{TagValue|key||value without link}}
If the third argument is used, the link goes to the key page.
What is typed | What displays | To what is linked |
---|---|---|
{{TagValue|highway|motorway}} | motorway | Tag:highway=motorway |
{{tagValue|highway|motorway|''type of the way''}} | type of the way | Tag:highway=motorway |
To force it to not link to the specific page, skip the second argument and put the text in the third or fourth argument like: | ||
{{TagValue|amenity||shelter}} | shelter | Key:amenity#amenity-shelter |
{{TagValue|bridge|||yes}} | yes | Key:bridge |
{{TagValue|ref|||''ref number''}} | ref number | Key:ref |
The main Key:name pages (using map features templates) need to be modified to work with this template in order to link them to anchors in these pages such as Key:name#value. For each value described, the matching row in tables listing and describing key values, and which starts with a leading line
|-
must be changed (by ionserting an identifier suitable as HTML anchors) into:
|- id="name-value"
with the name and the value separated with -, and with spaces changed into _ (note that some values containing separators such as #, , or ; cannot be anchored with valid identifiers). E.g. :
|- id="amenity-ferry_terminal"
Actually the key pages updated are:[1]
Parameter format
There is a second style with named parameters:
Wikimarkup | Note | Expansion | Rendering |
---|---|---|---|
|
The key-value combination has its own wiki page or redirects to the wiki page of the key. | [[Tag:highway=motorway|motorway]]
|
motorway |
{{TagValue|link=key|key=highway|value=motorway}}
|
The value is explained on the wiki page of the key, link to it. | [[Key:highway|motorway]]
|
motorway |
{{TagValue|link=key#|key=amenity|value=embassy}}
|
Links to the wiki page of the key, but adds a fragment to jump the corresponding paragraph, if an anchor has been set. | [[Key:amenity#amenity-embassy|embassy]]
|
embassy |
|
Do not link. Can be useful display a list of values on the key-wiki page. | biomass
|
biomass |
|
Links to the wiki page of the specific language. | [[JA:Tag:highway=motorway|motorway]]
|
motorway |
Key value. Links automatically to appropriate wiki page.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Key | 1 key | Main key of the tag (the part before =)
| String | required |
Value | 2 value | The value of the key (the part after =)
| String | suggested |
language | lang | link to the wiki page of the specified language
| String | optional |
link | link | defines where to link to
| String | optional |
unlinked value | 3 | description of value which should not be linked as value would be. Second parameter should be left blank for this to work. | String | deprecated |
See also
- {{TagKey}} Template:TagKey - showing key only
- {{Tag}} Template:Tag - showing key & value
- {{Value}} Template:Value - mark with light blue background and after font, looks similar like code
- {{Role}} Template:Role - mark with light blue background and after font, looks similar like code