Template:Place directory: Difference between revisions

From stencil.wiki
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
<includeonly>
=== {{#if:{{{title|}}}|{{{title}}}|{{#if:{{{city|}}}|{{{city}}}|{{#if:{{{state_province|}}}|{{{state_province}}}|{{#if:{{{country|}}}|{{{country}}}|(Region)}}}}}}}} ===
=== {{#if:{{{title|}}}|{{{title}}}|{{#if:{{{city|}}}|{{{city}}}|{{#if:{{{state_province|}}}|{{{state_province}}}|{{#if:{{{country|}}}|{{{country}}}|(Region)}}}}}}}} ({{#ask:[[Category:Places]]
  {{#if:{{{country|}}}|[[In country::{{{country}}}]]|}}
  {{#if:{{{state_province|}}}|[[In state/province::{{{state_province}}}]]|}}
  {{#if:{{{city|}}}|[[In city::{{{city}}}]]|}}
  | format=count
}}) ===
{| class="wikitable"
{| class="wikitable"
! Imported !! Active !! Inactive
! Imported !! Active !! Inactive !! Unknown
|-
|-
| {{#ask:[[Category:Places]][[Has status::Imported]]
| {{#ask:[[Category:Places]][[Has status::Imported]]
Line 18: Line 23:
   | headers=hide
   | headers=hide
}}
}}
| {{#ask:[[Category:Places]][[Is active::false]][[Has status::!Imported]]
| {{#ask:[[Category:Places]][[Is active::false]][[Has status::Closed||Inactive||Temporarily closed||Historic]]
  {{#if:{{{country|}}}|[[In country::{{{country}}}]]|}}
  {{#if:{{{state_province|}}}|[[In state/province::{{{state_province}}}]]|}}
  {{#if:{{{city|}}}|[[In city::{{{city}}}]]|}}
  | format=ul
  | headers=hide
}}
| {{#ask:[[Category:Places]][[Is active::false]][[Has status::Unknown]]
   {{#if:{{{country|}}}|[[In country::{{{country}}}]]|}}
   {{#if:{{{country|}}}|[[In country::{{{country}}}]]|}}
   {{#if:{{{state_province|}}}|[[In state/province::{{{state_province}}}]]|}}
   {{#if:{{{state_province|}}}|[[In state/province::{{{state_province}}}]]|}}
Line 31: Line 43:
This template can be called with values for country, state/province, and/or city. You can also optionally provide a title override for the header that appears above the table.
This template can be called with values for country, state/province, and/or city. You can also optionally provide a title override for the header that appears above the table.


<pre>{{Place directory|country=United States|state=Michigan}}</pre>
<pre>{{Place directory|country=United States|state_province=Michigan}}</pre>
{{Place directory|country=United States|state=Michigan}}
{{Place directory|country=United States|state_province=Michigan}}


== TemplateData ==
== TemplateData ==
</noinclude>
<templatedata>
{
"params": {
"title": {
"label": "Title",
"description": "Optional title for the header (H3) used above the table (otherwise uses the most specific of the provided location names).",
"type": "string"
},
"city": {
"label": "City",
"description": "The city to be queried.",
"type": "string"
},
"state_province": {
"label": "State/province",
"description": "The state/province to be queried.",
"type": "string"
},
"country": {
"label": "Country",
"description": "The country to be queried.",
"type": "string",
"suggested": true
}
},
"description": "Table display of imported, active, and inactive places in a region.",
"paramOrder": [
"city",
"state_province",
"country",
"title"
],
"format": "inline"
}
</templatedata></noinclude>

Latest revision as of 15:23, 5 March 2025

This is a helper template for displaying a list of places within a region, broken up into their type categories (so that you can easily display active + inactive + imported places at the same time. It's meant to aid regional validation work: Help:Validating a place (and was created specifically for Atlas:Midwest.

Usage

This template can be called with values for country, state/province, and/or city. You can also optionally provide a title override for the header that appears above the table.

{{Place directory|country=United States|state_province=Michigan}}

Michigan (15)

Imported Active Inactive Unknown

TemplateData

Table display of imported, active, and inactive places in a region.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Citycity

The city to be queried.

Stringoptional
State/provincestate_province

The state/province to be queried.

Stringoptional
Countrycountry

The country to be queried.

Stringsuggested
Titletitle

Optional title for the header (H3) used above the table (otherwise uses the most specific of the provided location names).

Stringoptional