Difference between revisions of "Template:Infobox Location/sandbox"

From Hitchwiki
Jump to navigation Jump to search
Line 7: Line 7:
 
<pre>
 
<pre>
 
{{Infobox Location
 
{{Infobox Location
 +
|name =
 +
|name_native =
 +
|symbol =
 
|country =  
 
|country =  
 
|state =  
 
|state =  
 +
|state_symbol =
 
|subdivision_type =  
 
|subdivision_type =  
 
|subdivision_name =  
 
|subdivision_name =  
 +
|subdivision_symbol =
 
|region =  
 
|region =  
 +
|region_symbol =
 
|subdivision2_type =  
 
|subdivision2_type =  
 
|subdivision2_name =  
 
|subdivision2_name =  
 +
|subdivision2_symbol =
 
|map =  
 
|map =  
 
|pop =  
 
|pop =  
Line 24: Line 31:
 
</pre>
 
</pre>
 
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 <code><nowiki>[[Category:somearea]]</nowiki></code> nor <code><nowiki>{{IsIn|somearea}}</nowiki></code> in a page itself. In fact it's better to delete them from a page if template works as intended.
 
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 <code><nowiki>[[Category:somearea]]</nowiki></code> nor <code><nowiki>{{IsIn|somearea}}</nowiki></code> 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. <code><nowiki>|state_symbol = Flag of Texas.svg</nowiki></code>
  
 
''map'' is in format like this: <code><nowiki><map lat='51.2' lng='3.2' zoom='11' /></nowiki></code>;
 
''map'' is in format like this: <code><nowiki><map lat='51.2' lng='3.2' zoom='11' /></nowiki></code>;
Line 35: Line 46:
 
! Result
 
! Result
 
|-
 
|-
| <pre>{{Infobox Location/sandbox
+
| In page named Bruges:<pre>{{Infobox Location/sandbox
|map = <map lat='51.2' lng='3.2' zoom='11' />
 
 
|country = Belgium
 
|country = Belgium
 +
|name_native = Brugge
 
|region = Vlaanderen
 
|region = Vlaanderen
 
|subdivision2_type = province
 
|subdivision2_type = province
 
|subdivision2_name = West-Vlaanderen
 
|subdivision2_name = West-Vlaanderen
 +
|map = <map lat='51.2' lng='3.2' zoom='11' />
 
|pop = 117073
 
|pop = 117073
|motorways = {{Abe|17}}, {{E|40}}
+
|motorways = {{Abe|17}} {{E|40}}
 
}}</pre>
 
}}</pre>
 
| {{Infobox Location/sandbox
 
| {{Infobox Location/sandbox
|map = <map lat='51.2' lng='3.2' zoom='11' />
+
|name = Bruges
 +
|name_native = Brugge
 
|country = Belgium
 
|country = Belgium
 
|region = Vlaanderen
 
|region = Vlaanderen
 
|subdivision2_type = province
 
|subdivision2_type = province
 
|subdivision2_name = West-Vlaanderen
 
|subdivision2_name = West-Vlaanderen
 +
|map = <map lat='51.2' lng='3.2' zoom='11' />
 
|pop = 117073
 
|pop = 117073
|motorways = {{Abe|17}}, {{E|40}}
+
|motorways = {{Abe|17}} {{E|40}}
 
}}
 
}}
 
|-
 
|-
Line 57: Line 71:
 
|country = USA
 
|country = USA
 
|state = Texas
 
|state = Texas
 +
|state_symbol = Flag of Texas.svg
 
}}</pre>
 
}}</pre>
 
| {{Infobox Location/sandbox
 
| {{Infobox Location/sandbox
 
|country = USA
 
|country = USA
 
|state = Texas
 
|state = Texas
 +
|state_symbol = Flag of Texas.svg
 +
}}
 +
|-
 +
| <pre>{{Infobox Location/sandbox
 +
|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
 +
|motorways = {{Ade|3}} {{Ade|6}} {{Ade|9}} {{Ade|73}}
 +
|BW = Germany/DE/Bavaria/02/Nuremberg/2861650
 +
|hitchbase = 34
 +
|links = [http://travel.wikia.com/wiki/N%C3%BCrnberg/Tips_for_hitchhikers Example link] [http://somelink Another link]
 +
}}</pre>
 +
| {{Infobox Location/sandbox
 +
|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
 +
|motorways = {{Ade|3}} {{Ade|6}} {{Ade|9}} {{Ade|73}}
 +
|BW = Germany/DE/Bavaria/02/Nuremberg/2861650
 +
|hitchbase = 34
 +
|links = [http://examplelink Example link] [http://anotherlink Another link]
 
}}
 
}}
 
|}
 
|}
 
</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. -->}}
 
{| class="infobox mw-collapsible"
 
{| class="infobox mw-collapsible"
! colspan="2" class="infobox-h1" | <div>{{PAGENAME}}</div>
+
! colspan="2" class="infobox-h1" | <div>{{#if: {{{symbol|}}} | [[File:{{{symbol}}}|x20px]] }}{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}}</div>''{{{name_native|}}}''
 
|-
 
|-
 
| colspan="2" class="infobox-map" | {{{map|}}}
 
| colspan="2" class="infobox-map" | {{{map|}}}
 
|-
 
|-
| colspan="2" class="infobox-h2" | '''Information'''
+
! colspan="2" class="infobox-h2" | '''Information'''
 
|-
 
|-
! Country: {{IsIn|{{{country}}}}}
+
! style="width: 50%;" | Country: [[File:Flag of {{{country}}}.svg|x20px|right|Flag of {{{country}}}]] {{IsIn|{{{country}}}}}
|[[File:Flag of {{{country}}}.svg|20px|border|Flag of {{{country}}}]] [[{{{country}}}]]
+
| [[{{{country}}}]]
 
|-
 
|-
{{#if: {{{state|}}} | ! State: {{#ifexist: {{{state}}} | {{IsIn|{{{state}}}}} | {{#ifexist: Category:{{{state}}} | {{IsIn|Category:{{{state}}}}} }} }}
+
{{#if: {{{state|}}} | ! State: {{#if: {{{state_symbol|}}} | [[File:{{{state_symbol}}}|x20px|right]] }} {{#ifexist: {{{state}}} | {{IsIn|{{{state}}}}} | {{#ifexist: Category:{{{state}}} | {{IsIn|Category:{{{state}}}}} }} }}
 
{{!}} [[{{{state}}}]] }}
 
{{!}} [[{{{state}}}]] }}
 
|-
 
|-
{{#if: {{{subdivision_type|}}} | {{#if: {{{subdivision_name|}}}| ! {{ucfirst:{{{subdivision_type}}}}}: {{#ifexist: {{{subdivision_name}}} | {{IsIn|{{{subdivision_name}}}}} | {{#ifexist: Category:{{{subdivision_name}}} | {{IsIn|Category:{{{subdivision_name}}}}} }} }}
+
{{#if: {{{subdivision_type|}}} | {{#if: {{{subdivision_name|}}}| ! {{ucfirst:{{{subdivision_type}}}}}: {{#if: {{{subdivision_symbol|}}} | [[File:{{{subdivision_symbol}}}|x20px|right]] }} {{#ifexist: {{{subdivision_name}}} | {{IsIn|{{{subdivision_name}}}}} | {{#ifexist: Category:{{{subdivision_name}}} | {{IsIn|Category:{{{subdivision_name}}}}} }} }}
 
{{!}} [[{{{subdivision_name}}}]] }} }}
 
{{!}} [[{{{subdivision_name}}}]] }} }}
 
|-
 
|-
{{#if: {{{region|}}} | ! Region: {{#ifexist: {{{region}}} | {{IsIn|{{{region}}}}} | {{#ifexist: Category:{{{region}}} | {{IsIn|Category:{{{region}}}}} }} }}
+
{{#if: {{{region|}}} | ! Region: {{#if: {{{region_symbol|}}} | [[File:{{{region_symbol}}}|x20px|right]] }} {{#ifexist: {{{region}}} | {{IsIn|{{{region}}}}} | {{#ifexist: Category:{{{region}}} | {{IsIn|Category:{{{region}}}}} }} }}
 
{{!}} [[{{{region}}}]] }}
 
{{!}} [[{{{region}}}]] }}
 
|-
 
|-
{{#if: {{{subdivision2_type|}}} | {{#if: {{{subdivision2_name|}}}| ! {{ucfirst:{{{subdivision2_type}}}}}: {{#ifexist: {{{subdivision2_name}}} | {{IsIn|{{{subdivision2_name}}}}} | {{#ifexist: Category:{{{subdivision2_name}}} | {{IsIn|Category:{{{subdivision2_name}}}}} }} }}
+
{{#if: {{{subdivision2_type|}}} | {{#if: {{{subdivision2_name|}}}| ! {{ucfirst:{{{subdivision2_type}}}}}: {{#if: {{{subdivision2_symbol|}}} | [[File:{{{subdivision2_symbol}}}|x20px|right]] }} {{#ifexist: {{{subdivision2_name}}} | {{IsIn|{{{subdivision2_name}}}}} | {{#ifexist: Category:{{{subdivision2_name}}} | {{IsIn|Category:{{{subdivision2_name}}}}} }} }}
 
{{!}} [[{{{subdivision2_name}}}]] }} }}
 
{{!}} [[{{{subdivision2_name}}}]] }} }}
 
|-
 
|-
Line 96: Line 143:
 
|-
 
|-
 
{{#if: {{{hitchbase|}}} | ! More info:
 
{{#if: {{{hitchbase|}}} | ! More info:
{{!}} [http://hitchbase.com/ergebnisse.php?LANG=eng&abfrage%5Bstartort%5D={{{hitchbase}}} Hitchbase] {{#if: {{{links|}}} | ,{{{links}}} }} | {{#if: {{{links|}}} | ! More info:
+
{{!}} [http://hitchbase.com/ergebnisse.php?LANG=eng&abfrage%5Bstartort%5D={{{hitchbase}}} Hitchbase] {{#if: {{{links|}}} | {{{links}}} }} | {{#if: {{{links|}}} | ! More info:
 
{{!}} {{{links}}} }} }}
 
{{!}} {{{links}}} }} }}
 
|-
 
|-

Revision as of 22:28, 30 October 2014

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 bellow 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 = 
|motorways = 
|BW = 
|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; motorways = 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 BeWelcome url for a particular place; 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.

Examples

Code Result
In page named Bruges:
{{Infobox Location/sandbox
|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
|motorways = {{Abe|17}} {{E|40}}
}}
{{#if: Bruges | Bruges | Infobox Location/sandbox
Brugge
<map lat='51.2' lng='3.2' zoom='11' />
Information
Country:
Flag of Belgium
Belgium
Region: Vlaanderen
Province: West-Vlaanderen
Population: 117,073
Motorways: A 17 E 40
{{Infobox Location/sandbox
|country = USA
|state = Texas
|state_symbol = Flag of Texas.svg
}}
{{#if: | {{{name}}} | Infobox Location/sandbox
'
Information
Country:
Flag of USA
USA
State:
Flag of Texas.svg
Texas
{{Infobox Location/sandbox
|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
|motorways = {{Ade|3}} {{Ade|6}} {{Ade|9}} {{Ade|73}}
|BW = Germany/DE/Bavaria/02/Nuremberg/2861650
|hitchbase = 34
|links = [http://travel.wikia.com/wiki/N%C3%BCrnberg/Tips_for_hitchhikers Example link] [http://somelink Another link]
}}
Wappen von Nürnberg.svg{{#if: Nuremberg | Nuremberg | Infobox Location/sandbox
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
Motorways: A 3 A 6 A 9 A 73
More info: Hitchbase Example link Another link
Find a host through BeWelcome