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 areasmay 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 über Punkten verwendet werdenkann Linien zugeordnet werdenkann Flächen zugeordnet werdenkann Relationen zugeordnet 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 areasmay 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 areasmay be used on relations
Documented values: 8
Useful combination
Status: approvedPage for proposal
Public-images-osm logo.svg noexit
Noexit.jpg
Description
To describe the end of a way. Show/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
Documented values: 1
Status: de facto
Public-images-osm logo.svg noexit
Noexit.jpg
Description
To describe the end of a way. Show/edit corresponding 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
Documented values: 1
Status: in use
Public-images-osm logo.svg noexit
Noexit.jpg
Beschreibung
Beschreibt den Endpunkt eines Weges, ab dem Punkt kein Weiterkommen möglich ist. Datenelement (data item) anzeigen/bearbeiten
Gruppe: Eigenschaften
Für diese Elemente
kann Punkten zugeordnet werdensollte nicht über Linien verwendet werdensollte nicht über Flächen verwendet werdensollte nicht über Relationen verwendet werden
Status: de facto
Public-images-osm logo.svg noexit
Noexit.jpg
Beschreibung
Beschreibt, dass ab diesem Punkt kein Weiterkommen möglich ist Beschreibung auf dieser Wikiseite bearbeiten Beschreibung im zugehörigen Datenelement bearbeiten
Gruppe: Eigenschaften
Für diese Elemente
kann Punkten zugeordnet werdensollte nicht über Linien verwendet werdensollte nicht über Flächen verwendet werdensollte nicht über Relationen verwendet werden
Status: in Benutzung