Difference between revisions of "Template:Table rel"

From geofiction
Jump to navigation Jump to search
m
m
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly>{|
 
<includeonly>{|
{{ #if:{{{relation|}}} |
+
{{Atab relation | relation={{{relation|}}} | type={{{type|}}} | column1tag={{{column1tag|}}} | column2tag={{{column2tag|}}} | column3tag={{{column3tag|}}} | column4tag={{{column4tag|}}} | column5tag={{{column5tag|}}} | column6tag={{{column6tag|}}} | column7tag={{{column7tag|}}} | column8tag={{{column8tag|}}} | column9tag={{{column9tag|}}} }}
{{ #if:{{{type|}}} |
+
{{Atab table | type={{{type|}}} | topic={{{topic|}}}  
{{#clear_external_data:}}{{#get_web_data:url=https://opengeofiction.net/api/0.6/relation/{{{relation}}}/full
+
| column1tag={{{column1tag|}}} | column1name={{{column1name|}}} | column1link={{{column1link|}}} | column1sort={{{column1sort|}}} | column1width={{{column1width|}}}  
|format=xml
+
| column2tag={{{column2tag|}}} | column2name={{{column2name|}}} | column2link={{{column2link|}}} | column2sort={{{column2sort|}}} | column2width={{{column2width|}}}   
|data=
+
| column3tag={{{column3tag|}}} | column3name={{{column3name|}}} | column3link={{{column3link|}}} | column3sort={{{column3sort|}}} | column3width={{{column3width|}}}
{{{type}}}_id=/osm/{{{type}}}/@id
+
| column4tag={{{column4tag|}}} | column4name={{{column4name|}}} | column4link={{{column4link|}}} | column4sort={{{column4sort|}}} | column4width={{{column4width|}}}
{{ #if:{{{column1tag|}}} |
+
| column5tag={{{column5tag|}}} | column5name={{{column5name|}}} | column5link={{{column5link|}}} | column5sort={{{column5sort|}}} | column5width={{{column5width|}}}
,{{{column1tag}}}=/osm/{{{type}}}/tag[@k='{{{column1tag}}}']/@v {{ #if:{{{column2tag|}}} |
+
| column6tag={{{column6tag|}}} | column6name={{{column6name|}}} | column6link={{{column6link|}}} | column6sort={{{column6sort|}}} | column6width={{{column6width|}}}
,{{{column2tag}}}=/osm/{{{type}}}/tag[@k='{{{column2tag}}}']/@v {{ #if:{{{column3tag|}}} |
+
| column7tag={{{column7tag|}}} | column7name={{{column7name|}}} | column7link={{{column7link|}}} | column7sort={{{column7sort|}}} | column7width={{{column7width|}}}
,{{{column3tag}}}=/osm/{{{type}}}/tag[@k='{{{column3tag}}}']/@v {{ #if:{{{column4tag|}}} |
+
| column8tag={{{column8tag|}}} | column8name={{{column8name|}}} | column8link={{{column8link|}}} | column8sort={{{column8sort|}}} | column8width={{{column8width|}}}
,{{{column4tag}}}=/osm/{{{type}}}/tag[@k='{{{column4tag}}}']/@v {{ #if:{{{column5tag|}}} |
+
| column9tag={{{column9tag|}}} | column9name={{{column9name|}}} | column9link={{{column9link|}}} | column9sort={{{column9sort|}}} | column9width={{{column9width|}}} }}
,{{{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:{{{collapsed|}}} |
 
{{{!}} class=&quot;wikitable sortable mw-collapsible mw-collapsed;&quot; |
 
{{{!}} class=&quot;wikitable sortable mw-collapsible&quot; }} |
 
{{{!}} class=&quot;wikitable sortable&quot; }} style=&quot;text-align:left; width:{{{width|500}}}px;&quot;
 
|-
 
! class=&quot;unsortable&quot; style=&quot;background:#{{{bgcolor|CCCCFF}}};&quot; {{ #if:{{{column9tag|}}} |
 
colspan=&quot;9&quot; | {{ #if:{{{column8tag|}}} |
 
colspan=&quot;8&quot; | {{ #if:{{{column7tag|}}} |
 
colspan=&quot;7&quot; | {{ #if:{{{column6tag|}}} |
 
colspan=&quot;6&quot; | {{ #if:{{{column5tag|}}} |
 
colspan=&quot;5&quot; | {{ #if:{{{column4tag|}}} |
 
colspan=&quot;4&quot; | {{ #if:{{{column3tag|}}} |
 
colspan=&quot;3&quot; | {{ #if:{{{column2tag|}}} |
 
colspan=&quot;2&quot; | {{ #if:{{{column1tag|}}} |
 
colspan=&quot;1&quot; }} }} }} }} }} }} }} }} }} | {{{topic|Table}}}
 
! class=&quot;unsortable&quot; style=&quot;background:#{{{bgcolor|CCCCFF}}}; text-align:right; width:50px;&quot; | {{Refresh}}
 
|-
 
{{ #if:{{{column1tag|}}} |
 
{{ #if:{{{column1sort|}}}{{{column1width|}}} |
 
! {{ #if:{{{column1sort|}}} |
 
class=&quot;unsortable&quot; }} {{ #if:{{{column1width|}}} |
 
style=&quot;width:{{{column1width}}}px;&quot; }} {{!}} | ! }} {{{column1name}}}
 
{{ #if:{{{column2tag|}}} |
 
{{ #if:{{{column2sort|}}}{{{column2width|}}} |
 
! {{ #if:{{{column2sort|}}} |
 
class=&quot;unsortable&quot; }} {{ #if:{{{column2width|}}} |
 
style=&quot;width:{{{column2width}}}px;&quot; }} {{!}} | ! }} {{{column2name}}}
 
{{ #if:{{{column3tag|}}} |
 
{{ #if:{{{column3sort|}}}{{{column3width|}}} |
 
! {{ #if:{{{column3sort|}}} |
 
class=&quot;unsortable&quot; }} {{ #if:{{{column3width|}}} |
 
style=&quot;width:{{{column3width}}}px;&quot; }} {{!}} | ! }} {{{column3name}}}
 
{{ #if:{{{column4tag|}}} |
 
{{ #if:{{{column4sort|}}}{{{column4width|}}} |
 
! {{ #if:{{{column4sort|}}} |
 
class=&quot;unsortable&quot; }} {{ #if:{{{column4width|}}} |
 
style=&quot;width:{{{column4width}}}px;&quot; }} {{!}} | ! }} {{{column4name}}}
 
{{ #if:{{{column5tag|}}} |
 
{{ #if:{{{column5sort|}}}{{{column5width|}}} |
 
! {{ #if:{{{column5sort|}}} |
 
class=&quot;unsortable&quot; }} {{ #if:{{{column5width|}}} |
 
style=&quot;width:{{{column5width}}}px;&quot; }} {{!}} | ! }} {{{column5name}}}
 
{{ #if:{{{column6tag|}}} |
 
{{ #if:{{{column6sort|}}}{{{column6width|}}} |
 
! {{ #if:{{{column6sort|}}} |
 
class=&quot;unsortable&quot; }} {{ #if:{{{column6width|}}} |
 
style=&quot;width:{{{column6width}}}px;&quot; }} {{!}} | ! }} {{{column6name}}}
 
{{ #if:{{{column7tag|}}} |
 
{{ #if:{{{column7sort|}}}{{{column7width|}}} |
 
! {{ #if:{{{column7sort|}}} |
 
class=&quot;unsortable&quot; }} {{ #if:{{{column7width|}}} |
 
style=&quot;width:{{{column7width}}}px;&quot; }} {{!}} | ! }} {{{column7name}}}
 
{{ #if:{{{column8tag|}}} |
 
{{ #if:{{{column8sort|}}}{{{column8width|}}} |
 
! {{ #if:{{{column8sort|}}} |
 
class=&quot;unsortable&quot; }} {{ #if:{{{column8width|}}} |
 
style=&quot;width:{{{column8width}}}px;&quot; }} {{!}} | ! }} {{{column8name}}}
 
{{ #if:{{{column9tag|}}} |
 
{{ #if:{{{column9sort|}}}{{{column9width|}}} |
 
! {{ #if:{{{column9sort|}}} |
 
class=&quot;unsortable&quot; }} {{ #if:{{{column9width|}}} |
 
style=&quot;width:{{{column9width}}}px;&quot; }} {{!}} | ! }} {{{column9name}}} }} }} }} }} }} }} }} }} }}
 
! class=&quot;unsortable&quot; | Map
 
|-
 
{{#for_external_table:<nowiki/>
 
{{ #if:{{{column1tag|}}} |
 
{{!}} {{ #if:{{{column1link|}}} |
 
[[{{{{{{column1tag|}}}}}}]] | {{{{{{column1tag|}}}}}}
 
}}
 
{{ #if:{{{column2tag|}}} |
 
{{!}} {{ #if:{{{column2link|}}} |
 
[[{{{{{{column2tag|}}}}}}]] | {{{{{{column2tag|}}}}}}
 
}}
 
{{ #if:{{{column3tag|}}} |
 
{{!}} {{ #if:{{{column3link|}}} |
 
[[{{{{{{column3tag|}}}}}}]] | {{{{{{column3tag|}}}}}}
 
}}
 
{{ #if:{{{column4tag|}}} |
 
{{!}} {{ #if:{{{column4link|}}} |
 
[[{{{{{{column4tag|}}}}}}]] | {{{{{{column4tag|}}}}}}
 
}}
 
{{ #if:{{{column5tag|}}} |
 
{{!}} {{ #if:{{{column5link|}}} |
 
[[{{{{{{column5tag|}}}}}}]] | {{{{{{column5tag|}}}}}}
 
}}
 
{{ #if:{{{column6tag|}}} |
 
{{!}} {{ #if:{{{column6link|}}} |
 
[[{{{{{{column6tag|}}}}}}]] | {{{{{{column6tag|}}}}}}
 
}}
 
{{ #if:{{{column7tag|}}} |
 
{{!}} {{ #if:{{{column7link|}}} |
 
[[{{{{{{column7tag|}}}}}}]] | {{{{{{column7tag|}}}}}}
 
}}
 
{{ #if:{{{column8tag|}}} |
 
{{!}} {{ #if:{{{column8link|}}} |
 
[[{{{{{{column8tag|}}}}}}]] | {{{{{{column8tag|}}}}}}
 
}}
 
{{ #if:{{{column9tag|}}} |
 
{{!}} {{ #if:{{{column9link|}}} |
 
[[{{{{{{column9tag|}}}}}}]] | {{{{{{column9tag|}}}}}}
 
}} }} }} }} }} }} }} }} }} }}
 
{{!}} [[File:OGFmapicon.png|18px|link=]] <span class=&quot;plainlinks&quot;>[https://opengeofiction.net/{{{type}}}/{{{{{{type}}}_id}}} map]</span>
 
{{!}}-
 
}} |}
 
 
{{#clear_external_data:}}
 
{{#clear_external_data:}}
|}
+
|} [[Category:Site using autotable]]</includeonly><noinclude>
</includeonly><noinclude>
 
 
 
=Usage=
 
<pre>{{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
 
}}</pre>
 
 
 
=Example: List of Gobeletplain Cafés=
 
<pre>{{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
 
}}</pre>
 
  
 +
==Test==
 
{{Table rel
 
{{Table rel
 
| relation    = 48497
 
| relation    = 48497
Line 251: Line 34:
 
| column4name  = Note
 
| column4name  = Note
 
| column4tag  = ldata:note
 
| column4tag  = ldata:note
| column5sort  =
 
| column5name  =
 
| column5tag  =
 
| column6sort  =
 
| column6name  =
 
| column6tag  =
 
| column7sort  =
 
| column7name  =
 
| column7tag  =
 
| column8sort  =
 
| column8name  =
 
| column8tag  =
 
| column9sort  =
 
| column9name  =
 
| column9tag  =
 
}}
 
 
=Tests=
 
{{Table rel
 
| search1      = name/Gobeletplain
 
| type        = node
 
| topic        = List of Gobeletplain Cafés
 
| width        = 550
 
| column1sort  = no
 
| column1name  = Name
 
| column1tag  = name
 
| column1width =
 
| column1link  = yes
 
| column2sort  =
 
| column2name  = City
 
| column2tag  = is_in:city
 
| column3sort  =
 
| column3name  = Country
 
| column3tag  = is_in:country
 
| column4sort  = no
 
| column4name  = Note
 
| column4tag  = ldata:note
 
| column5sort  =
 
| column5name  =
 
| column5tag  =
 
| column6sort  =
 
| column6name  =
 
| column6tag  =
 
| column7sort  =
 
| column7name  =
 
| column7tag  =
 
| column8sort  =
 
| column8name  =
 
| column8tag  =
 
| column9sort  =
 
| column9name  =
 
| column9tag  =
 
 
}}
 
}}
  
[[Category:Autotable templates]]
+
[[Category:Overpass templates]]</noinclude>
[[Category:Experimental templates]]</noinclude>
 

Latest revision as of 18:10, 31 January 2023


Test

Error while fetching data from URL https://opengeofiction.net/api/0.6/relation/48497/full: $2.
There was a problem during the HTTP request: 410 Gone
Could not get URL https://opengeofiction.net/api/0.6/relation/48497/full after 3 tries.
List of Gobeletplain Cafés MER-refresh.png
Name City Country Note Map