Difference between revisions of "Template:Largest cities/doc"

From blackwiki
Jump to navigation Jump to search
imported>RidwanFadilArif
imported>Funandtrvl
(fx /doc)
Line 1: Line 1:
<includeonly>{| {{#if:{{{class|<noinclude>x</noinclude>}}} | class="navbox" style="width: 100%" | width="100%" style="margin-left: auto; margin-right: auto; width: 100%; border: 1px solid darkgray; background: #f9f9f9" }}
+
{{Documentation subpage}}
<!-- TITLE & SOURCE -->
+
<!-- Categories and interwikis go at the bottom of this page. -->
!colspan="10" style="padding:0.3em 0; line-height:1.4em; <!--(for sake of wrapped line plus footnote ref)-->"| {{navbar|{{{name|{{FULLPAGENAME}}}}}|mini=1|style=float: left; margin-left:0.75em}} <span style="font-size:120%;">Largest cities or towns of [[{{{country}}}]]</span><br/><span style="font-weight:normal;">{{#if:{{{stat_ref|<noinclude>x</noinclude>}}} | {{{stat_ref|Source?}}} | Source? }}</span>
+
A template meant to facilitate the creation of a "Largest cities in country X" template. It accommodates either 10 or 20 entries, plus 4 pictures representing the 4 largest cities.
|- <!-- TABLE HEADINGS -->
+
 
{{#if:{{{img_1|<noinclude>x</noinclude>}}} | !  }}<!-- blank heading over images 1 & 2 -->
+
== Usage ==
! {{#if:{{{list_by_pop|<noinclude>x</noinclude>}}} | [[{{{list_by_pop}}}|Rank]] | {{#ifexist: List of cities in {{{country}}} by population | [[List of cities in {{{country}}} by population|Rank]] | Rank }} }}
+
<pre style="font-size:95%; overflow:auto;">
! {{#ifexist: List of cities in {{{country}}} | [[List of cities in {{{country}}}|City name]] | City name }}
+
{{Largest cities
! {{#if:{{{div_link|<noinclude>x</noinclude>}}} | [[{{{div_link}}}]] | [[{{{div_name|Administrative division}}}s of {{{country}}}|{{{div_name|Administrative division}}}]] }}
+
| name        = <!-- name of the template, e.g. Largest cities of Chile -->
! {{#if:{{{list_by_pop|<noinclude>x</noinclude>}}} | [[{{{list_by_pop}}}| Pop.]] | {{#ifexist: List of cities in {{{country}}} by population | [[List of cities in {{{country}}} by population|Pop.]] | Pop. }} }}
+
| class      = <!-- can be changed to "nav" to alter the template's colour scheme -->
{{#if:{{{city_11|<noinclude>x</noinclude>}}} | <!-- determines whether there should be two columns or just one -->
+
| country    = <!-- the name of the country, e.g. Chile -->
! {{#if:{{{list_by_pop|<noinclude>x</noinclude>}}} | [[{{{list_by_pop}}}|Rank]] | {{#ifexist: List of cities in {{{country}}} by population | [[List of cities in {{{country}}} by population|Rank]] | Rank }} }}
+
| stat_ref    = <!-- source of the pop. figures, e.g. Instituto Nacional de Estadisticas de Chile or use {{URL| }} -->
! {{#ifexist: List of cities in {{{country}}} | [[List of cities in {{{country}}}|City name]] | City name }}
+
| list_by_pop = <!-- link to the list of cities in the given country, if possible sorted by population -->
! {{#if:{{{div_link|<noinclude>x</noinclude>}}} | [[{{{div_link}}}]] | [[{{{div_name}}}s of {{{country}}}|{{{div_name}}}]] }}
+
| div_name   = <!-- the name of the main administrative subdivision, e.g. Province, State, Region... -->
! {{#if:{{{list_by_pop|<noinclude>x</noinclude>}}} | [[{{{list_by_pop}}}| Pop.]] | {{#ifexist: List of cities in {{{country}}} by population | [[List of cities in {{{country}}} by population|Pop.]] | Pop. }} }}
+
| div_link    = <!-- the template will automatically create a link for "div_name of country" (e.g. Provinces of Chile), if this doesn't work you can use this field -->
}} <!-- ends if -->
+
 
{{#if:{{{img_3|<noinclude>x</noinclude>}}} | ! }}<!-- blank heading over images 3 & 4 -->
+
| city_1      = <!-- a link to the article about the largest city -->
|-
+
| div_1      = <!-- link to the administrative subdivision where said city is located -->
{{#if:{{{img_1|<noinclude>x</noinclude>}}} | <!-- IMAGES 1 & 2 -->
+
| pop_1      = <!-- population, do include the commas to separate the thousands -->
{{!}} rowspan=11 style="text-align: center" {{!}} [[File:{{{img_1|Information example page2 300px.jpg}}}|border|120px|{{{city_1}}}]]<br>[[{{{city_1}}}]]<br>
+
| img_1      = <!-- a picture showing an overview of the city -->
[[File:{{{img_2|Information example page2 300px.jpg}}}|border|120px|{{{city_2}}}]]<br>[[{{{city_2}}}]] }}
+
 
<!-- LIST OF CITIES, SUBDIVISIONS, POPULATION FIGURES -->
+
| city_2 =  | div_2 =  | pop_2 = | img_2 =
| align=center style="background:#f0f0f0;" | 1 ||align=left | '''[[{{{city_1}}}]]''' ||align=left | [[{{{div_1}}}]] ||align="right"| {{{pop_1}}} {{#if:{{{city_11|<noinclude>x</noinclude>}}} | {{!!}} align=center style="background:#f0f0f0;" {{!}} 11 {{!!}}align=left {{!}} '''[[{{{city_11}}}]]''' {{!!}}align=left {{!}} [[{{{div_11}}}]] {{!!}}align="right" {{!}} {{{pop_11}}}
+
| city_3 =  | div_3 =  | pop_3 = | img_3 =
 +
| city_4 =  | div_4 =  | pop_4 = | img_4 =
 +
| city_5 =  | div_5 =  | pop_5 =
 +
| city_6 =  | div_6 =  | pop_6 =
 +
| city_7 =  | div_7 =  | pop_7 =
 +
| city_8 =  | div_8 =  | pop_8 =
 +
| city_9 =  | div_9 = | pop_9 =
 +
| city_10 = | div_10 = | pop_10 =
 +
| city_11 = | div_11 = | pop_11 =
 +
| city_12 = | div_12 = | pop_12 =
 +
| city_13 = | div_13 = | pop_13 =
 +
| city_14 = | div_14 = | pop_14 =
 +
| city_15 = | div_15 = | pop_15 =
 +
| city_16 = | div_16 = | pop_16 =
 +
| city_17 = | div_17 = | pop_17 =
 +
| city_18 = | div_18 = | pop_18 =
 +
| city_19 = | div_19 = | pop_19 =  
 +
| city_20 = | div_20 = | pop_20 =  
 
}}
 
}}
{{#if:{{{img_3|<noinclude>x</noinclude>}}} | <!-- IMAGES 3 & 4 -->
+
</pre>
{{!}} rowspan=11 style="text-align: center" {{!}} [[File:{{{img_3|Information example page2 300px.jpg}}}|border|120px|{{{city_3}}}]]<br>[[{{{city_3}}}]]<br>
+
 
[[File:{{{img_4|Information example page2 300px.jpg}}}|border|120px|{{{city_4}}}]]<br>[[{{{city_4}}}]] }}
+
== Test ==
|-
+
{{Largest cities/testcases}}
| align=center style="background:#f0f0f0;" | 2 ||align=left | '''[[{{{city_2}}}]]''' ||align=left | [[{{{div_2}}}]] ||align="right"| {{{pop_2}}} {{#if:{{{city_12|<noinclude>x</noinclude>}}} | {{!!}} align=center style="background:#f0f0f0;" {{!}} 12 {{!!}}align=left {{!}} '''[[{{{city_12}}}]]''' {{!!}}align=left {{!}} [[{{{div_12}}}]] {{!!}}align="right" {{!}} {{{pop_12}}}
+
 
}}
+
<includeonly>
|-
+
<!-- Categories and interwikis go here: -->
| align=center style="background:#f0f0f0;" | 3 ||align=left | '''[[{{{city_3}}}]]''' ||align=left | [[{{{div_3}}}]] ||align="right"| {{{pop_3}}} {{#if:{{{city_13|<noinclude>x</noinclude>}}} | {{!!}} align=center style="background:#f0f0f0;" {{!}} 13 {{!!}}align=left {{!}} '''[[{{{city_13}}}]]''' {{!!}}align=left {{!}} [[{{{div_13}}}]] {{!!}}align="right" {{!}} {{{pop_13}}}
+
[[Category:City population templates| ]]
}}
+
 
|-
+
[[ar:قالب:المدن_الكبرى]]
| align=center style="background:#f0f0f0;" | 4 ||align=left | '''[[{{{city_4}}}]]''' ||align=left | [[{{{div_4}}}]] ||align="right"| {{{pop_4}}} {{#if:{{{city_14|<noinclude>x</noinclude>}}} | {{!!}} align=center style="background:#f0f0f0;" {{!}} 14 {{!!}}align=left {{!}} '''[[{{{city_14}}}]]''' {{!!}}align=left {{!}} [[{{{div_14}}}]] {{!!}}align="right" {{!}} {{{pop_14}}}
+
[[bs:Šablon:Najveći gradovi]]
}}
+
[[eo:Ŝablono:Plej grandaj urboj]]
|-
+
[[fa:الگو:شهرهای اصلی]]
| align=center style="background:#f0f0f0;" | 5 ||align=left | '''[[{{{city_5}}}]]''' ||align=left | [[{{{div_5}}}]] ||align="right"| {{{pop_5}}} {{#if:{{{city_15|<noinclude>x</noinclude>}}} | {{!!}} align=center style="background:#f0f0f0;" {{!}} 15 {{!!}}align=left {{!}} '''[[{{{city_15}}}]]''' {{!!}}align=left {{!}} [[{{{div_15}}}]] {{!!}}align="right" {{!}} {{{pop_15}}}
+
[[ko::최대 도시]]
}}
+
[[it:Template:Città principali]]
|-
+
[[ka:თარგი:უდიდესი ქალაქები]]
| align=center style="background:#f0f0f0;" | 6 ||align=left | '''[[{{{city_6}}}]]''' ||align=left | [[{{{div_6}}}]] ||align="right"| {{{pop_6}}} {{#if:{{{city_16|<noinclude>x</noinclude>}}} | {{!!}} align=center style="background:#f0f0f0;" {{!}} 16 {{!!}}align=left {{!}} '''[[{{{city_16}}}]]''' {{!!}}align=left {{!}} [[{{{div_16}}}]] {{!!}}align="right" {{!}} {{{pop_16}}}
+
[[pt:Predefinição:Maiores cidades]]
}}
+
[[zh:Template:Largest cities]]
|-
+
[[nl:Sjabloon:Grootste steden]]
| align=center style="background:#f0f0f0;" | 7 ||align=left | '''[[{{{city_7}}}]]''' ||align=left | [[{{{div_7}}}]] ||align="right"| {{{pop_7}}} {{#if:{{{city_17|<noinclude>x</noinclude>}}} | {{!!}} align=center style="background:#f0f0f0;" {{!}} 17 {{!!}}align=left {{!}} '''[[{{{city_17}}}]]''' {{!!}}align=left {{!}} [[{{{div_17}}}]] {{!!}}align="right" {{!}} {{{pop_17}}}
+
[[ur:سانچہ:بڑے شہر]]
}}
+
</includeonly>
|-
 
| align=center style="background:#f0f0f0;" | 8 ||align=left | '''[[{{{city_8}}}]]''' ||align=left | [[{{{div_8}}}]] ||align="right"| {{{pop_8}}} {{#if:{{{city_18|<noinclude>x</noinclude>}}} | {{!!}} align=center style="background:#f0f0f0;" {{!}} 18 {{!!}}align=left {{!}} '''[[{{{city_18}}}]]''' {{!!}}align=left {{!}} [[{{{div_18}}}]] {{!!}}align="right" {{!}} {{{pop_18}}}
 
}}
 
|-
 
| align=center style="background:#f0f0f0;" | 9 ||align=left | '''[[{{{city_9}}}]]''' ||align=left | [[{{{div_9}}}]] ||align="right"| {{{pop_9}}} {{#if:{{{city_19|<noinclude>x</noinclude>}}} | {{!!}} align=center style="background:#f0f0f0;" {{!}} 19 {{!!}}align=left {{!}} '''[[{{{city_19}}}]]''' {{!!}}align=left {{!}} [[{{{div_19}}}]] {{!!}}align="right" {{!}} {{{pop_19}}}
 
}}
 
|-
 
| align=center style="background:#f0f0f0;" | 10 ||align=left | '''[[{{{city_10}}}]]''' ||align=left | [[{{{div_10}}}]] ||align="right"| {{{pop_10}}} {{#if:{{{city_20|<noinclude>x</noinclude>}}} | {{!!}} align=center style="background:#f0f0f0;" {{!}} 20 {{!!}}align=left {{!}} '''[[{{{city_20}}}]]''' {{!!}}align=left {{!}} [[{{{div_20}}}]] {{!!}}align="right" {{!}} {{{pop_20}}}
 
}}
 
|-
 
|}</includeonly><noinclude>
 
{{documentation}}
 
</noinclude>
 

Revision as of 00:50, 1 March 2013

A template meant to facilitate the creation of a "Largest cities in country X" template. It accommodates either 10 or 20 entries, plus 4 pictures representing the 4 largest cities.

Usage

{{Largest cities
| name        = <!-- name of the template, e.g. Largest cities of Chile -->
| class       = <!-- can be changed to "nav" to alter the template's colour scheme -->
| country     = <!-- the name of the country, e.g. Chile -->
| stat_ref    = <!-- source of the pop. figures, e.g. Instituto Nacional de Estadisticas de Chile or use {{URL| }} -->
| list_by_pop = <!-- link to the list of cities in the given country, if possible sorted by population -->
| div_name    = <!-- the name of the main administrative subdivision, e.g. Province, State, Region... -->
| div_link    = <!-- the template will automatically create a link for "div_name of country" (e.g. Provinces of Chile), if this doesn't work you can use this field -->

| city_1      = <!-- a link to the article about the largest city -->
| div_1       = <!-- link to the administrative subdivision where said city is located -->
| pop_1       = <!-- population, do include the commas to separate the thousands -->
| img_1       = <!-- a picture showing an overview of the city -->

| city_2 =  | div_2 =  | pop_2 = | img_2 =
| city_3 =  | div_3 =  | pop_3 = | img_3 = 
| city_4 =  | div_4 =  | pop_4 = | img_4 =
| city_5 =  | div_5 =  | pop_5 = 
| city_6 =  | div_6 =  | pop_6 = 
| city_7 =  | div_7 =  | pop_7 = 
| city_8 =  | div_8 =  | pop_8 = 
| city_9 =  | div_9 =  | pop_9 = 
| city_10 = | div_10 = | pop_10 =
| city_11 = | div_11 = | pop_11 =
| city_12 = | div_12 = | pop_12 = 
| city_13 = | div_13 = | pop_13 = 
| city_14 = | div_14 = | pop_14 = 
| city_15 = | div_15 = | pop_15 = 
| city_16 = | div_16 = | pop_16 = 
| city_17 = | div_17 = | pop_17 = 
| city_18 = | div_18 = | pop_18 = 
| city_19 = | div_19 = | pop_19 = 
| city_20 = | div_20 = | pop_20 = 
}}

Test