Difference between revisions of "Template:Infobox Location"

From Hitchwiki
Jump to navigation Jump to search
m
 
(10 intermediate revisions by 5 users not shown)
Line 3: Line 3:
  
 
== How to use this Template? ==
 
== How to use this Template? ==
For using this template, copy&paste the following code to the '''top''' of the city article you want to edit. You can delete unused parameters. To better understand how to use it see description bellow or [[#Examples|examples]].
+
For using this template, copy&paste the following code to the '''top''' of the city article you want to edit. You can delete unused parameters. To better understand how to use it see description below or [[#Examples|examples]].
  
 
<pre>
 
<pre>
Line 25: Line 25:
 
|plate =  
 
|plate =  
 
|roads =  
 
|roads =  
|BW =
 
 
|hitchbase =  
 
|hitchbase =  
 
|links =  
 
|links =  
Line 39: Line 38:
 
''pop'' = population; ''plate'' = licence plate of the city/region; ''roads'' = major roads going around or through the city, you can write it as a plain text, links or use templates e.g. [[Template:E]];
 
''pop'' = population; ''plate'' = licence plate of the city/region; ''roads'' = major roads going around or through the city, you can write it as a plain text, links or use templates e.g. [[Template:E]];
  
''BW'' = part of the [http://bewelcome.org BeWelcome] url for a particular place; ''hitchbase'' = ID of the city at [http://hitchbase.com Hitchbase]; ''links'' = other links. Use last 2 parameters only if there is '''useful''' and '''english written''' information which is not already at hitchwiki.
+
''hitchbase'' = ID of the city at [http://hitchbase.com Hitchbase]; ''links'' = other links. Use last 2 parameters only if there is '''useful''' and '''english written''' information which is not already at hitchwiki.
 +
 
 +
== Troubleshooting ==
 +
You can experiment with template functions at [[:Template:Infobox Location/sandbox]] and try to use it in [[Special:Mypage/sandbox|your sandbox]] or as a preview at any page. If you see somewhere somehow broken infobox, you can edit that page data (!) not this template. You can also write any ideas how to make it better to the [[{{TALKPAGENAME}}|talk page]].
  
 
== Examples ==
 
== Examples ==
Line 90: Line 92:
 
|plate = N
 
|plate = N
 
|roads = {{Ade|3}} {{Ade|6}} {{Ade|9}} {{Ade|73}}
 
|roads = {{Ade|3}} {{Ade|6}} {{Ade|9}} {{Ade|73}}
|BW = Germany/DE/Bavaria/02/Nuremberg/2861650
 
 
|hitchbase = 34
 
|hitchbase = 34
 
|links = [http://examplelink Link1] [http://somelink Link2]
 
|links = [http://examplelink Link1] [http://somelink Link2]
Line 105: Line 106:
 
|plate = N
 
|plate = N
 
|roads = {{Ade|3}} {{Ade|6}} {{Ade|9}} {{Ade|73}}
 
|roads = {{Ade|3}} {{Ade|6}} {{Ade|9}} {{Ade|73}}
|BW = Germany/DE/Bavaria/02/Nuremberg/2861650
 
 
|hitchbase = 34
 
|hitchbase = 34
 
|links = [http://examplelink Link1] [http://somelink Link2]
 
|links = [http://examplelink Link1] [http://somelink Link2]
 
}}
 
}}
 
|}
 
|}
 
== Troubleshooting ==
 
You can experiment with template functions at [[:Template:Infobox Location/sandbox]] and try to use it in [[Special:Mypage/sandbox|your sandbox]] or as a preview at any page. If you see somewhere somehow broken infobox, you can edit that page data (!) not this template. You can also write any ideas how to make it better to the [[{{TALKPAGENAME}}|talk page]].
 
  
 
</noinclude><includeonly>{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{Category|{{{country}}}|{{{state}}}|{{{subdivision_name}}}|{{{region}}}|{{{subdivision2_name}}}}}|<!-- Don't categorize when not in main (article) space. -->}}
 
</noinclude><includeonly>{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{Category|{{{country}}}|{{{state}}}|{{{subdivision_name}}}|{{{region}}}|{{{subdivision2_name}}}}}|<!-- Don't categorize when not in main (article) space. -->}}
Line 150: Line 147:
 
{{!}} {{{links}}} }} }}
 
{{!}} {{{links}}} }} }}
 
|-
 
|-
{{#if: {{{TR|}}} | ! colspan=2 {{!}} Meet fellow hitchhikers on [https://www.trustroots.org/#!/search?location={{PAGENAME}} Trustroots] }}
+
! colspan=2 {{!}} Meet fellow hitchhikers on [[:trustroots-location:{{urlencode:{{PAGENAME}}}}|Trustroots]]
|-
 
{{#if: {{{BW|}}} | ! colspan=2 {{!}} Find a host through [http://www.bewelcome.org/places/{{{BW}}} BeWelcome] }}
 
 
|}</includeonly><noinclude>
 
|}</includeonly><noinclude>
 
[[Category:Infoboxes]]
 
[[Category:Infoboxes]]
 
</noinclude>
 
</noinclude>

Latest revision as of 09:56, 19 October 2017

This template can be used to produce an Infobox for human settlements (cities, towns, villages, communities) as well as other administrative districts, counties, provinces, etc.

How to use this Template?

For using this template, copy&paste the following code to the top of the city article you want to edit. You can delete unused parameters. To better understand how to use it see description below or examples.

{{Infobox Location
|name = 
|name_native = 
|symbol = 
|country = 
|state = 
|state_symbol = 
|subdivision_type = 
|subdivision_name = 
|subdivision_symbol = 
|region = 
|region_symbol = 
|subdivision2_type = 
|subdivision2_name = 
|subdivision2_symbol = 
|map = 
|pop = 
|plate = 
|roads = 
|hitchbase = 
|links = 
}}

You have to specify in which country the location is. Other parameters are optional. You can use state and region. For specifying different administrative divisions such a province, county etc. use parameters subdivision_type with subdivision name (considered smaller than state and bigger than region) and subdivision2_type with subdivision2_name (considered smaller than region). All of the above parameters are used for page categorization and breadcrumb navigation so write them correctly and as a plain text. You don't have to use [[Category:somearea]] nor {{IsIn|somearea}} in a page itself. In fact it's better to delete them from a page if template works as intended.

Normally the heading of infobox is the same as pagename (which should be in English if possible). If for some reason you need to have different heading use name parameter. For location name in native language use parameter name_native - that will be showed somewhat smaller under main heading.

You can as well specify various symbols (flags, coat of arms) by parameters symbol, state_symbol, subdivision_symbol, region_symbol and subdivision2_symbol. Just find appropriate picture at wikimedia or upload it to hitchwiki and write its name e.g. |state_symbol = Flag of Texas.svg

map is in format like this: <map lat='51.2' lng='3.2' zoom='11' />; pop = population; plate = licence plate of the city/region; roads = major roads going around or through the city, you can write it as a plain text, links or use templates e.g. Template:E;

hitchbase = ID of the city at Hitchbase; links = other links. Use last 2 parameters only if there is useful and english written information which is not already at hitchwiki.

Troubleshooting

You can experiment with template functions at Template:Infobox Location/sandbox and try to use it in your sandbox or as a preview at any page. If you see somewhere somehow broken infobox, you can edit that page data (!) not this template. You can also write any ideas how to make it better to the talk page.

Examples

Code Result
In page named Bruges:
{{Infobox Location
|country = Belgium
|name_native = Brugge
|region = Vlaanderen
|subdivision2_type = province
|subdivision2_name = West-Vlaanderen
|map = <map lat='51.2' lng='3.2' zoom='11' />
|pop = 117073
|roads = {{Abe|17}} {{E|40}}
}}
Bruges
Brugge
<map lat='51.2' lng='3.2' zoom='11' />
Information
Country:
Flag of Belgium
Belgium
Region: Vlaanderen
Province: West-Vlaanderen
Population: 117,073
Major roads: A 17 E 40
Meet fellow hitchhikers on Trustroots
{{Infobox Location
|country = USA
|state = Texas
|state_symbol = Flag of Texas.svg
}}
Infobox Location
Information
Country:
Flag of USA
USA
State:
Flag of Texas.svg
Texas
Meet fellow hitchhikers on Trustroots
{{Infobox Location
|name = Nuremberg
|name_native = Nürnberg
|symbol = Wappen von Nürnberg.svg
|country = Germany
|map = <map lat='49.417' lng='11.1' zoom='10' />
|pop = 502491
|state = Bavaria
|state_symbol = Coat of arms of Bavaria.png
|plate = N
|roads = {{Ade|3}} {{Ade|6}} {{Ade|9}} {{Ade|73}}
|hitchbase = 34
|links = [http://examplelink Link1] [http://somelink Link2]
}}
Wappen von Nürnberg.svgNuremberg
Nürnberg
<map lat='49.417' lng='11.1' zoom='10' />
Information
Country:
Flag of Germany
Germany
State:
Coat of arms of Bavaria.png
Bavaria
Population: 502,491
Licence plate: N
Major roads: A 3 A 6 A 9 A 73
More info: Hitchbase Link1 Link2
Meet fellow hitchhikers on Trustroots