Template:Taglist/doc

From OpenStreetMap Wiki
Jump to navigation Jump to search

Usage

  • {{Taglist|lang = lang |with_count = with_count |with_rendering = with_rendering |tags = tags }}

Generates an automatic table of tags with information from taginfo.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
tagstags

any related tags separated by commas

Example
highway=motorway,trunk,primary,secondary,tertiary
Stringrequired
with_countwith_count

''true/false'' – if you want to add the usage counts from the database

Default
false
Auto value
true
Booleansuggested
with_renderingwith_rendering

''true/false'' – if you want to add an image showing how the tag is rendered in OpenStreetMap Carto, the standard OSM map stylesheet

Default
false
Auto value
true
Booleansuggested
langlang

language to display; use a language code; the default is selected from current page using Template:Langcode

Example
de
Stringoptional

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:

LOADING TAG LIST... (If you do not see this tag list, you need to enable JavaScript)
This table is auto-generated. See Template:Taglist for a documentation on it.

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:

LOADING TAG LIST... (If you do not see this tag list, you need to enable JavaScript)
Эта таблица создаётся автоматически. Документацию по ней смотрите на Template:Taglist.

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:

LOADING TAG LIST... (If you do not see this tag list, you need to enable JavaScript)
This table is auto-generated. See Template:Taglist for a documentation on it.

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:

LOADING TAG LIST... (If you do not see this tag list, you need to enable JavaScript)
This table is auto-generated. See Template:Taglist for a documentation on it.

.

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}}
LOADING TAG LIST... (If you do not see this tag list, you need to enable JavaScript)
This table is auto-generated. See Template:Taglist for a documentation on it.

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

External links

This template appears to be using https://taginfo.openstreetmap.org/js/taglists.js