Template:Infobox Admin Subdivision: Difference between revisions
Template page
More actions
Eloise Zomia (talk | contribs) No edit summary |
Eloise Zomia (talk | contribs) No edit summary |
||
| Line 18: | Line 18: | ||
}} | }} | ||
{{#if:{{{show_map|}}}| | {{#if:{{{show_map|}}}| | ||
{{!}} colspan="2" class="lw-infobox__map-container" {{!}} <div class="lw-infobox__map lw-map" data-smw-query="[[Category:Accessions]][[Has {{{admin_property|province}}}::{{{admin_value|{{PAGENAME}}}}}]]{{!}}?Has coordinates{{!}}?Has descriptive name{{!}}?Has conservation priority{{!}}?Has accession ID"></div><div class="lw-infobox__map-expand" title="Expand map">⛶</div> | {{!}} colspan="2" class="lw-infobox__map-container" {{!}} <div class="lw-infobox__map lw-map" data-center="{{{coordinates|}}}" {{#if:{{{boundary|}}}|data-boundary="{{{boundary}}}" data-boundary-style="admin"}} data-smw-query="[[Category:Accessions]][[Has {{{admin_property|province}}}::{{{admin_value|{{PAGENAME}}}}}]]{{!}}?Has coordinates{{!}}?Has descriptive name{{!}}?Has conservation priority{{!}}?Has accession ID"></div><div class="lw-infobox__map-expand" title="Expand map">⛶</div> | ||
{{!}}- | {{!}}- | ||
}} | }} | ||
| Line 90: | Line 90: | ||
|Has population={{{population|}}} | |Has population={{{population|}}} | ||
|Has population year={{{population_year|}}} | |Has population year={{{population_year|}}} | ||
|Has boundary={{{boundary|}}} | |||
}} | }} | ||
</includeonly> | </includeonly> | ||
Latest revision as of 18:01, 28 March 2026
Usage
This template works for any level of administrative subdivision. Use the subdivision_type, parent_label, admin_property, and admin_value parameters to adapt it to any country's hierarchy.
Cambodia (district)
{{Infobox Admin Subdivision
|name = Kirivong
|local_name = ស្រុកកិរីវង់
|subdivision_type = District
|country = Cambodia
|parent = Takeo
|parent_label = Province
|admin_property = admin 2
|admin_value = Kirivong
|show_map = yes
|coordinates = 10.641000, 104.844000
|category = Cambodian Districts
}}
India (district)
{{Infobox Admin Subdivision
|name = Kullu District
|local_name = कुल्लू जिला
|subdivision_type = District
|country = India
|parent = Himachal Pradesh
|parent_label = State
|admin_property = admin 2
|admin_value = Kullu
|show_map = yes
|coordinates = 31.958000, 77.109000
|category = Indian Districts
}}
Province-level example
{{Infobox Admin Subdivision
|name = Takeo
|local_name = តាកែវ
|subdivision_type = Province
|country = Cambodia
|admin_property = province
|show_map = yes
|coordinates = 10.990000, 104.780000
|capital = Doun Kaev
|category = Cambodian Provinces
}}
Parameters
| Parameter | Description | Default | Example |
|---|---|---|---|
| name | Display name (defaults to page name) | {{PAGENAME}} | Kirivong |
| local_name | Name in local script | ស្រុកកិរីវង់ | |
| image | Hero image filename | Kirivong_landscape.jpg | |
| image_alt | Alt text for image | name value | Bayong Kor mountains |
| image_caption | Caption for hero image | View from Phnom Bayong | |
| show_map | Set to "yes" to display accession map | yes | |
| subdivision_type | What kind of division this is | Province | District |
| country | Country page name | Cambodia | |
| parent | Parent subdivision page name | Takeo | |
| parent_label | Label for the parent field | Province | Province |
| admin_property | SMW property suffix for map/count queries | province | admin 2 |
| admin_value | Value to match in SMW queries (use when page name differs from stored property value) | {{PAGENAME}} | Kirivong |
| capital | Administrative capital | Doun Kaev | |
| coordinates | Centroid (lat, lon) | 10.641000, 104.844000 | |
| area | Geographic area | 928 km² | |
| elevation_range | Elevation range | 50–400 m | |
| population | Population figure | 178,000 | |
| population_year | Census year for population | 2019 | |
| category | MediaWiki category for this page | Admin Subdivisions | Cambodian Districts |
The admin_property parameter
This controls which SMW property the map query and accession count use to filter results.
| Admin level | admin_property value | Resulting query filter |
|---|---|---|
| Province/State | province | [[Has province::…]]
|
| District | admin 2 | [[Has admin 2::…]]
|
| Commune/Subdistrict | admin 3 | [[Has admin 3::…]]
|
| Village/Ward | admin 4 | [[Has admin 4::…]]
|
The admin_value parameter
When the wiki page name does not match the value stored in accession properties, use admin_value to override. For example, the page "Kirivong district" needs admin_value = Kirivong because accessions store Has admin 2 = Kirivong (without the "district" suffix). If omitted, defaults to {{PAGENAME}}.