Template:KeyDescription/Sandbox/doc

From OpenStreetMap Wiki
Jump to navigation Jump to search

This is a proposed replacement for the {{KeyDescription}} template. The goal is to let it get the data from the data items if needed, but continue to work with the template parameters as before. This offers a migration path to removing all the template parameters in the future. Note that the template itself has just a few lines. All of the work is done in Module:DescriptionFromDataItem. At a minimum, template needs to figure out what key it is describing. If this template is placed in a key page, it will automatically determine the right data item, so inserting it is as simple as {{KeyDescription}}, with no parameters. Magic. For this help page, we have to specify the key parameter. Everything else is optional.

TODO
  • Support statuslink URLs (stored as references in some of the entities)
  • The "status" localization word should come from data item, not be hardcoded in {{Description}}
  • Import and support seealso, required, and other, less structured values

Dynamic - no template parameters

These templates do not provide any functional parameters. For this demo page, you still have to specify the key/tag values because the current page is not where the template will be placed. Also need to specify the language code (might be required), and hide the languagelink bar to reduce the clutter.

Done
  • descriptions
  • image
  • element icons (node/way/area/...)
  • status
  • Support local restrictions with the limited to language (P26) qualifiers (e.g. noexit=* should not be used on ways in the German-speaking regions)
{{KeyDescription/Sandbox
  |key=bridge:movable
  |lang=en
  |languagelinks=no
}}
lang=en lang=fr lang=de
Public-images-osm logo.svg bridge:movable
MovableBridge roll.gif
Description
The mechanism by which a movable bridge moves to clear the way below. Show/edit corresponding data item.
Group: bridges
Used on these elements
should not be used on nodesmay be used on waysmay be used on areas (and multipolygon relations)may be used on relations
Documented values: 8
Useful combination
Status: approvedPage for proposal
Public-images-osm logo.svg bridge:movable
MovableBridge roll.gif
Description
Type de pont mobile Modifier ou traduire cette description.
Groupe: Ponts
Utilisé pour ces éléments
ne devrait pas être utilisé sur des nœudspeut être utilisé sur des cheminspeut être utilisé sur des zonespeut être utilisé sur des relations
Combinaisons utiles
Statut : ApprouvéPage for proposal
Public-images-osm logo.svg bridge:movable
MovableBridge roll.gif
Beschreibung
Mechanismus, der die bewegliche Brücke öffnet Datenelement (data item) anzeigen/bearbeiten
Gruppe: Brücken
Für diese Elemente
sollte nicht auf Punkte angewendet werdenkann auf Linien angewendet werdenkann auf Flächen (und Multipolygon-Relationen) angewendet werdenkann auf Relationen angewendet werden
Dokumentierte Werte: 6
Sinnvolle Kombinationen
Status: akzeptiertPage for proposal

Template with parameters that partially match data item

Here are some examples of how side cards will be different when generated with and without parameters. In each pair, left card is generated just like above, without parameters.

bridge:movable=*

{{KeyDescription/Sandbox
|key=bridge:movable
}}
{{KeyDescription/Sandbox
|key=bridge:movable
|image=File:MovableBridge roll.gif
|description=The mechanism by which a movable bridge moves to clear the way beloweea.
|group=bridges
|onNode=no
|onWay=yes
|onArea=yes
|onRelation=yes
|combination=
* {{Tag|bridge|movable}}
* {{Tag|man_made|bridge}}
|status=approved
|statuslink=Proposed features/Bridge types
}}

noexit=* with the English description:

{{KeyDescription/Sandbox
|key=noexit
}}
{{KeyDescription/Sandbox
|key=noexit
|description=To describe the end of a way.
|image=File:Noexit.jpg
|group=restrictions
|onNode=yes
|onWay=yes
|onArea=no
|onRelation=no
|status=in use
}}

noexit=* with the German description.
Note that the onWay here is different because the German-speaking community prohibits it. See noexit (Q501).

{{KeyDescription/Sandbox
|key=noexit
|lang=de
}}
{{KeyDescription/Sandbox
|key=noexit
|image=File:Noexit.jpg
|description=Beschreibt, dass ab diesem Punkt kein Weiterkommen möglich ist
|onNode=yes
|onWay=no
|onArea=no
|onRelation=no
|lang=de
|status=in use
}}
Public-images-osm logo.svg bridge:movable
MovableBridge roll.gif
Description
The mechanism by which a movable bridge moves to clear the way below. Show/edit corresponding data item.
Group: bridges
Used on these elements
should not be used on nodesmay be used on waysmay be used on areas (and multipolygon relations)may be used on relations
Documented values: 8
Useful combination
Status: approvedPage for proposal
Public-images-osm logo.svg bridge:movable
MovableBridge roll.gif
Description
The mechanism by which a movable bridge moves to clear the way beloweea. Edit this description in the wiki page. Edit this description in the data item.
Group: bridges
Used on these elements
should not be used on nodesmay be used on waysmay be used on areas (and multipolygon relations)may be used on relations
Documented values: 8
Useful combination
Status: approvedPage for proposal
Public-images-osm logo.svg noexit
Description
This is a one-value key used only with the value "yes". See noexit=yesShow/edit corresponding data item.
Group: properties
Used on these elements
may be used on nodesshould not be used on waysshould not be used on areasshould not be used on relations (except multipolygon relations)
Documented values: 2
Status: de facto
Public-images-osm logo.svg noexit
Noexit.jpg
Description
To describe the end of a way. Edit this description in the wiki page. Edit this description in the data item.
Group: restrictions
Used on these elements
may be used on nodesmay be used on waysshould not be used on areasshould not be used on relations (except multipolygon relations)
Documented values: 2
Status: in use
Public-images-osm logo.svg noexit
Gruppe: Eigenschaften
Für diese Elemente
kann auf Punkte angewendet werdensollte nicht auf Linien angewendet werdensollte nicht auf Flächen angewendet werdensollte nicht auf Relationen angewendet werden (außer Multipolygon-Relationen)
Status: de facto
Public-images-osm logo.svg noexit
Noexit.jpg
Beschreibung
Beschreibt, dass ab diesem Punkt kein Weiterkommen möglich ist Datenelement (data item) anzeigen/bearbeiten
Gruppe: Eigenschaften
Für diese Elemente
kann auf Punkte angewendet werdensollte nicht auf Linien angewendet werdensollte nicht auf Flächen angewendet werdensollte nicht auf Relationen angewendet werden (außer Multipolygon-Relationen)
Status: in Benutzung