Changes between Initial Version and Version 1 of NameTemplate


Ignore:
Timestamp:
2011-10-16T21:31:23+02:00 (14 years ago)
Author:
jttt
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NameTemplate

    v1 v1  
     1Name templates can be used to define custom formatting for gpx waypoints or osm primitives (for example in Relation or Selection list).
     2
     3= Syntax =
     4* {var} - use value of variable var
     5* ?{condition1 'value1' | condition2 'value2 | 'value3'} - use value1 if condition1 is satisfied, value3 is no condition is satisfied. Condition can be either explicit -  the same expression as in search or filters is used or implicit - value is used when all variables used inside exists
     6
     7= Samples =
     8||= Template =||= Tags =||= Result =||
     9|| House number {addr:housenumber} || addr:housenumber=10 || House number 10
     10|| ?{ 'House number {addr:housenumber} at {addr:street}' | 'House number {addr:housenumber}'  } || addr:housenumber=10 || House number 10
     11|| || addr:housenumber=10, addr:street=Abbey road || House number 10 at Abbey road
     12|| ?{ admin_level = 2 'NUTS 1' | admin_level = 4 'NUTS 2' | admin_level = 6 'NUTS 3' |  'Admin level {admin_level}'} ||  admin_level=4 || NUTS 2
     13|| || admin_level=5 || Admin level 5
     14
     15= Available values =
     16For osm primitives formating, value of any tag can be used, use {special:everything} to see what values are available for you gpx waypoints.
     17Few additional variables are available  via special prefix:
     18- {special:everything} prints all available values, available for both primitive and waypoint formatting.
     19- {special:id} prints id of osm primitive
     20- {special:localName} prints localized name, that is value of name:lang for your language if the tag exists or just value of name tag.