Help:Automated wiki tables and lists
After Luciano started with the excellent idea of using mapped data to directly create lists for the wiki, I write my first "tutorial" here. It is based on my own template, but as soon as you got the main ideas, you can also create your own templates if the existing ones do not meet all your requirements.
- The following example describes the creation of a shop-list with JOSM.
Mapping first location
First we draw the location and create all usual tags (here: a shop with the name Luciano's Potpourri).
In addition, we have to add all data which should show up later on in the wiki list or table, e.g. the country's and city's name (here: the shop is opened in Brugham in Mergany, so we use "is_in:country=Mergany" and "is_in:city=Brugham").
After that, we create a new relation and add the node/way.
After the upload, double-click on the relation in JOSM and press ctrl+c. Then change to the wiki and press ctrl+v. You see the corresponding relation number (here: in our case we receive "relation 65276"). The relation number is necessary to tell the wiki which relation should be displayed.
Adding another location
To add a new shop to the list, we have to create the shop as shown before and add it to the same(!) relation. In order to do so, we first load the corresponding relation. This can be done by pressing ctrl+shif+o or selecting File > Download object. There you enter r+number of the relation (here:r65276).
The creation of the object (node/way) with corresponding tags was described above.
Double-click on the relation in JOSM and press ctrl+c. Then change to the wiki and press ctrl+v. You see the corresponding relation number (here: in our case we receive "relation 65276"). The relation number is necessary to tell the wiki which relation should be displayed.
Using an automated table
After we get the relation number (here: 65276), all members can be displayed in the wiki by using an automated table template. In addition, the member type must be defined: are the members nodes or ways (here: nodes)?
Then for each column in the table a name must be defined and the corresponding node/way tag which should show up there. Here: the first column is the shop's name, the table head should show "Name" and the value is defined by the tag "name". So we use "column1name = Name" and "column1tag = name". The same procedure is done for the second column, where the "Country" is listed, defined by the tag "is_in:country" and so on. Up to ten columns are possible in this template. If some columns should not be sortable (here: the fourth column) we use "column4sort = no".).
This is how the code looks like:
{{MER-autoTable_adv | relation = 65276 | type = node | topic = Luciano's Potpourri shops | width = 550 | column1name = Name | column1tag = name | column2name = Country | column2tag = is_in:country | column3name = City | column3tag = is_in:city | column4sort = no | column4name = Note | column4tag = ldata:note }}
And this is the final result: Template:MER-autoTable adv
If you have any improvements, please add it on the [[Talk:OGF:Automated_tables_and_lists|talk page]].