User:Moresby/SelectLinkTarget/doc

From OpenStreetMap Wiki
Jump to navigation Jump to search

This template generates the canonical wiki pagename for a given tag key or key/value pair, provided the value looks as if it should be linked. Language codes are incorporated as appropriate. If the value looks as if it should not be linked, an empty result is produced.

The following values are deemed to be not worth linking:

  • true
  • false
  • yes
  • no
  • *
  • values starting with a '
  • values starting with a "
  • numbers
  • empty value
  • any other value starting with a non-letter

Usage

The following additional parameters may be provided:

  • lang: generate the name for this language version of the page in question
  • link: affects the behaviour as follows:
    • yes: generate the name of the appropriate page, even if it would otherwise be deemed not worth linking
    • no: generate no name at all
    • auto (or empty): default behaviour, as described above
    • any other value: produce this value as the output

Examples

This wikitext… …produces this…
{{User:Moresby/SelectLinkTarget|highway}} Key:highway
{{User:Moresby/SelectLinkTarget|highway|residential}} Tag:highway=residential
{{User:Moresby/SelectLinkTarget|bridge|yes}}
{{User:Moresby/SelectLinkTarget|bridge|yes/no}}
{{User:Moresby/SelectLinkTarget|ref|''ref number''}}
{{User:Moresby/SelectLinkTarget|name|*}}
{{User:Moresby/SelectLinkTarget|height|2m}}
{{User:Moresby/SelectLinkTarget|!highway}} Key:!highway
{{User:Moresby/SelectLinkTarget|!highway|!residential}}
{{User:Moresby/SelectLinkTarget|generator:output:electricity}} Key:generator:output:electricity
{{User:Moresby/SelectLinkTarget|generator:output:electricity|yes}}
{{User:Moresby/SelectLinkTarget|lanes|2}}
{{User:Moresby/SelectLinkTarget|lanes|2|link=yes}} Tag:lanes=2
{{User:Moresby/SelectLinkTarget|highway|residential|link=no}}
{{User:Moresby/SelectLinkTarget|highway|lang=de}} DE:Key:highway
{{User:Moresby/SelectLinkTarget|highway|residential|lang=de}} DE:Tag:highway=residential
{{User:Moresby/SelectLinkTarget|dessert|cheesecake|link=wikipedia:cheesecake}} wikipedia:cheesecake

See also