Difference between revisions of "Template:Table rel"

From geofiction
Jump to navigation Jump to search
m
m
Line 1: Line 1:
<includeonly>{|
+
<includeonly>{| {{Template:Rel data | {{{relation|}}} | {{{type|}}} | {{{column1tag|}}} | {{{column2tag|}}} | {{{column3tag|}}} | {{{column4tag|}}} | {{{column5tag|}}} | {{{column6tag|}}} | {{{column7tag|}}} | {{{column8tag|}}} | {{{column9tag|}}} }}<!--
{{ #if:{{{relation|}}} |
 
{{ #if:{{{type|}}} |
 
{{#clear_external_data:}}{{#get_web_data:url=https://opengeofiction.net/api/0.6/relation/{{{relation}}}/full
 
|format=xml
 
|data=
 
{{{type}}}_id=/osm/{{{type}}}/@id
 
{{ #if:{{{column1tag|}}} |
 
,{{{column1tag}}}=/osm/{{{type}}}/tag[@k='{{{column1tag}}}']/@v {{ #if:{{{column2tag|}}} |
 
,{{{column2tag}}}=/osm/{{{type}}}/tag[@k='{{{column2tag}}}']/@v {{ #if:{{{column3tag|}}} |
 
,{{{column3tag}}}=/osm/{{{type}}}/tag[@k='{{{column3tag}}}']/@v {{ #if:{{{column4tag|}}} |
 
,{{{column4tag}}}=/osm/{{{type}}}/tag[@k='{{{column4tag}}}']/@v {{ #if:{{{column5tag|}}} |
 
,{{{column5tag}}}=/osm/{{{type}}}/tag[@k='{{{column5tag}}}']/@v {{ #if:{{{column6tag|}}} |
 
,{{{column6tag}}}=/osm/{{{type}}}/tag[@k='{{{column6tag}}}']/@v {{ #if:{{{column7tag|}}} |
 
,{{{column7tag}}}=/osm/{{{type}}}/tag[@k='{{{column7tag}}}']/@v {{ #if:{{{column8tag|}}} |
 
,{{{column8tag}}}=/osm/{{{type}}}/tag[@k='{{{column8tag}}}']/@v {{ #if:{{{column9tag|}}} |
 
,{{{column9tag}}}=/osm/{{{type}}}/tag[@k='{{{column9tag}}}']/@v }} }} }} }} }} }} }} }} }}
 
|use xpath
 
}} }} |
 
{{ #if:{{{search1|}}} |
 
{{#clear_external_data:}}{{#get_web_data:url=https://osm3s.opengeofiction.net/api/interpreter?data={{#if:{{{area|}}} | <!--
 
 
 
########################### Mergany
 
 
 
-->{{#ifeq:{{{area}}} | MER |
 
(area%5B%22admin_level%22=2%5D%5B%22name%22=%22Ӎєrɠąɲɣ%22%5D;)-%3E.bndarea;%0A | <!--
 
 
 
########################### other areas
 
 
 
-->(area%5B%22admin_level%22%5D%5B%22name%22=%22{{#replace:{{{area}}}| |%20}}%22%5D;)-%3E.bndarea;%0A }} }}<!--
 
 
 
########################### search1
 
 
 
-->{{{type}}}{{#if:{{{area|}}} |
 
(area.bndarea) }}%5B%22{{lc: {{#replace:{{#titleparts:{{{search1}}}|1|1}}| |_}} }}%22{{#if: {{#titleparts:{{{search1}}}|2|2}} | %3D%22{{MER-opq-enablenames | {{{search1}}} }}%22 }}%5D<!--
 
 
 
########################### search2
 
 
 
-->{{#if:{{{search2|}}} | %5B%22{{lc: {{#replace:{{#titleparts:{{{search2}}}|1|1}}| |_}} }}%22{{#if: {{#titleparts:{{{search2}}}|2|2}} | %3D%22{{MER-opq-enablenames | {{{search2}}} }}%22 }}%5D }}<!--
 
 
 
########################### search3
 
 
 
-->{{#if:{{{search3|}}} | %5B%22{{lc: {{#replace:{{#titleparts:{{{search3}}}|1|1}}| |_}} }}%22{{#if: {{#titleparts:{{{search3}}}|2|2}} | %3D%22{{MER-opq-enablenames | {{{search3}}} }}%22 }}%5D }};out;<!--
 
 
 
-->
 
|format=xml
 
|data=
 
{{{type}}}_id=/osm/{{{type}}}/@id
 
{{ #if:{{{column1tag|}}} |
 
,{{{column1tag}}}=/osm/{{{type}}}/tag[@k='{{{column1tag}}}']/@v {{ #if:{{{column2tag|}}} |
 
,{{{column2tag}}}=/osm/{{{type}}}/tag[@k='{{{column2tag}}}']/@v {{ #if:{{{column3tag|}}} |
 
,{{{column3tag}}}=/osm/{{{type}}}/tag[@k='{{{column3tag}}}']/@v {{ #if:{{{column4tag|}}} |
 
,{{{column4tag}}}=/osm/{{{type}}}/tag[@k='{{{column4tag}}}']/@v {{ #if:{{{column5tag|}}} |
 
,{{{column5tag}}}=/osm/{{{type}}}/tag[@k='{{{column5tag}}}']/@v {{ #if:{{{column6tag|}}} |
 
,{{{column6tag}}}=/osm/{{{type}}}/tag[@k='{{{column6tag}}}']/@v {{ #if:{{{column7tag|}}} |
 
,{{{column7tag}}}=/osm/{{{type}}}/tag[@k='{{{column7tag}}}']/@v {{ #if:{{{column8tag|}}} |
 
,{{{column8tag}}}=/osm/{{{type}}}/tag[@k='{{{column8tag}}}']/@v {{ #if:{{{column9tag|}}} |
 
,{{{column9tag}}}=/osm/{{{type}}}/tag[@k='{{{column9tag}}}']/@v }} }} }} }} }} }} }} }} }}
 
|use xpath
 
}} }} }}<!--
 
______________________________________________________________________
 
__/\\\\____________/\\\\_____/\\\\\\\\\\\_____________________________       
 
  _\/\\\\\\________/\\\\\\___/\\\/////////\\\___________________________     
 
  _\/\\\//\\\____/\\\//\\\__\//\\\______\///____/\\\____________________     
 
    _\/\\\\///\\\/\\\/_\/\\\___\////\\\________/\\\\\\\\\\\__/\\/\\\\\\\__   
 
    _\/\\\__\///\\\/___\/\\\______\////\\\____\////\\\////__\/\\\/////\\\_   
 
      _\/\\\____\///_____\/\\\_________\////\\\____\/\\\______\/\\\___\///__ 
 
      _\/\\\_____________\/\\\__/\\\______\//\\\___\/\\\_/\\__\/\\\_________ 
 
        _\/\\\_____________\/\\\_\///\\\\\\\\\\\/____\//\\\\\___\/\\\_________
 
        _\///______________\///____\///////////_______\/////____\///__________
 
          ______________________________________________________________________
 
  
 
-->{{ #if:{{{collapsible|}}} |
 
-->{{ #if:{{{collapsible|}}} |

Revision as of 23:10, 2 August 2022


Usage

{{Table rel
| relation    = ...relation number
| type        = {node,way} ...only ways OR nodes are possible
| topic       = ...topic of table
| width       = ...total width of table
| column1sort = {no, } ...if 1st column is unsortable
| column1name = ...name of 1st column
| column1tag  = ...name of 1st column tag to search for
| column2sort = {no, } ...if 2nd column is unsortable
| column2name = ...name of 2nd column
| column2tag  = ...name of 2nd column tag to search for
| column3sort = {no, } ...if 3rd column is unsortable
| column3name = ...name of 3rd column
| column3tag  = ...name of 3rd column tag to search for
| column4sort = {no, } ...if 4th column is unsortable
| column4name = ...name of 4th column
| column4tag  = ...name of 4th column tag to search for
| column5sort = {no, } ...if 5th column is unsortable
| column5name = ...name of 5th column
| column5tag  = ...name of 5th column tag to search for
| column6sort = {no, } ...if 6th column is unsortable
| column6name = ...name of 6th column
| column6tag  = ...name of 6th column tag to search for
| column7sort = {no, } ...if 7th column is unsortable
| column7name = ...name of 7th column
| column7tag  = ...name of 7th column tag to search for
| column8sort = {no, } ...if 8th column is unsortable
| column8name = ...name of 8th column
| column8tag  = ...name of 8th column tag to search for
| column9sort = {no, } ...if 9th column is unsortable
| column9name = ...name of 9th column
| column9tag  = ...name of 9th column tag to search for
}}

Example: List of Gobeletplain Cafés

{{Table rel
| relation    = 48497
| type        = node
| topic       = List of Gobeletplain Cafés
| width       = 550
| column1name = Name
| column1tag  = name
| column2name = City
| column2tag  = is_in:city
| column3name = Country
| column3tag  = is_in:country
| column4sort = no
| column4name = Note
| column4tag  = ldata:note
}}
List of Gobeletplain Cafés MER-refresh.png
Name City Country Note Map


Tests

List of Gobeletplain Cafés MER-refresh.png
Name City Country Note Map