Template:Taglist/doc
This is a documentation subpage for Template:Taglist. It contains usage information, categories and other content or metadata that is not part of the original template. |
Usage
- {{Taglist|lang = lang |with_count = with_count |with_rendering = with_rendering |tags = tags }}
Generates an automatic table of tags with information from taginfo.
Parameter | Description | Type | Status | |
---|---|---|---|---|
tags | tags | any related tags separated by commas
| String | required |
with_count | with_count | ''true/false'' – if you want to add the usage counts from the database
| Boolean | suggested |
with_rendering | with_rendering | ''true/false'' – if you want to add an image showing how the tag is rendered in OpenStreetMap Carto, the standard OSM map stylesheet
| Boolean | suggested |
lang | lang | language to display; use a language code; the default is selected from current page using Template:Langcode
| String | optional |
Examples
Use the template {{Taglist}} with a list of tags as the tags
parameter:
{{Taglist|tags=highway=motorway,trunk,primary,maxspeed=*,oneway=yes}}
And you'll get a table like this:
Note that you can use the Asterisk (*) instead of a value to get the description/icon from a key.
Setting the language
You can set the language the list should be in using the lang
parameter. The default is en (English). So...
{{Taglist|tags=highway=motorway,trunk,primary,secondary,tertiary,oneway=yes|lang=ru}}
...gives you a table in Russian:
Note that for the localization to work two things are needed:
1. Taginfo needs to have the texts used in the table header for the language, they need to be in https://github.com/joto/taginfo/blob/master/web/public/js/taglists.js. (Updates will only be available after manual intervention which can take a few days.)
2. The key/tag description must be available in the wiki in this language. Update the info box on the key/tag page for this to work (description will not used from data items). Updates will be available after the next update of taginfo, usually within a day.
Add object counts to table
Add the parameter with_count=true
if you want to add the usage counts from the database:
{{Taglist|tags=highway=motorway,trunk,primary,secondary,tertiary,maxspeed=*|with_count=true}}
will show up as:
Add rendering example to table
Add the parameter with_rendering=true
if you want to add an image showing how the tag is rendered in openstreetmap-carto, the standard OSM map stylesheet:
{{Taglist|tags=shop=tea,bag|with_rendering=true}}
will show up as:
.
VERY IMPORTANT : the renderings of taglists don't work if there is one (or more) underscore in the file's name. But it will work if you replace all the underscores by a space. Example : for the tag tree_row, the name of the rendering file is File:Rendering-natural_tree_row-mapnik.png. In the osmcarto-rendering of the english page for the tag natural:tree_row, in the ValueDescription, you have to write : osmcarto-rendering=File:Rendering-natural tree row-mapnik.png.
If you have changed the name of the file in the ValueDescription of the tag, keep in mind that you will have to wait one day to see the result : taglists work with the taginfo API. Taginfo is updated once a day so you have to wait the next update to see the result in your taglists.
Create a list with "all" tags for a key
You can create a list of "all" tags for a given key by just giving that key in the list:
{{Taglist|tags=access}}
The list will not contain all tags, but only those documented on the wiki. To be more specific: The tag page must exist and contain the Template:ValueDescription info box. This use is probably not what you want in most cases, because the list can and will change without you noticing and you might get strange tags in there you didn't want to have. So it is better to write down exactly what tags you want to have in this list.
See also
- {{Taginfo2}}
- {{Taginfo entry}}
External links
This template appears to be using https://taginfo.openstreetmap.org/js/taglists.js