Revision as of 16:24, 24 February 2019 view sourceBrownHairedGirl (talk | contribs)Autopatrolled, Extended confirmed users, File movers, Pending changes reviewers, Rollbackers2,942,733 edits sort key for Category:YYYY in countrytname = "/Disestablishments"← Previous edit | Latest revision as of 05:33, 10 May 2024 view source SilverLocust (talk | contribs)Autopatrolled, Administrators25,251 editsm SilverLocust moved page Template:DisestcatCountry to Template:Disestablishment category in country: Requested by HouseBlaster at WP:RM/TR: "Use English spacing per WP:TPN". Like corresponding move to Template:Establishment category in country. | ||
(9 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly><!-- | |||
<includeonly>{{DisestcatCountry/checkuse}}{{YearInCountryPortalBox|{{{3|}}}|{{{4|}}}|{{{5|}}}|year={{{1}}}{{{2}}}}} | |||
# The first step is to check whether this uses the old-style year parameters, of the form {{DisestcatCountry| YYY | Y | country }} | |||
{{Category explanation|organizations, places, companies or other things that ended or were disestablished in ''']''' in the year ''']'''}} | |||
# The new form is {{DisestcatCountry| country }} | |||
{| class="toccolours" style="margin:1em auto;" | |||
# If it uses the old format, then issue an error message | |||
|{{LinkCatIfExists2|{{{1}}}0s disestablishments in {{{3}}}|{{{1}}}0s disestablishments in {{{3}}}}}: | |||
# | |||
|{{LinkCatIfExists2|{{#expr: {{{1}}}0 - 1}} disestablishments in {{{3}}}|←}} {{LinkCatIfExists2|{{{1}}}0 disestablishments in {{{3}}}|{{{1}}}0}} • {{LinkCatIfExists2|{{{1}}}1 disestablishments in {{{3}}}|{{{1}}}1}} • {{LinkCatIfExists2|{{{1}}}2 disestablishments in {{{3}}}|{{{1}}}2}} • {{LinkCatIfExists2|{{{1}}}3 disestablishments in {{{3}}}|{{{1}}}3}} • {{LinkCatIfExists2|{{{1}}}4 disestablishments in {{{3}}}|{{{1}}}4}} • {{LinkCatIfExists2|{{{1}}}5 disestablishments in {{{3}}}|{{{1}}}5}} • {{LinkCatIfExists2|{{{1}}}6 disestablishments in {{{3}}}|{{{1}}}6}} • {{LinkCatIfExists2|{{{1}}}7 disestablishments in {{{3}}}|{{{1}}}7}} • {{LinkCatIfExists2|{{{1}}}8 disestablishments in {{{3}}}|{{{1}}}8}} • {{LinkCatIfExists2|{{{1}}}9 disestablishments in {{{3}}}|{{{1}}}9}} {{LinkCatIfExists2|{{#expr: {{{1}}}9 + 1}} disestablishments in {{{3}}}|→}} | |||
# We check this by concatenating the first 2 parameters, and then checking that they start with digits. | |||
|} | |||
-->{{#ifeq: {{#invoke:String|match|s={{{1}}}{{{2}}}|pattern=^%d+$|start=1|match=1|plain=false|nomatch=%%nomatch%%}}|%%nomatch%%<!-- | |||
{{Category see also if exists 2 |{{{1}}}{{{2}}} establishments in {{{3}}}|{{{1}}}0s establishments in {{{3}}}}} | |||
-->|<!-- | |||
] | |||
# NOT using the old-style parameters | |||
{{#ifeq:{{{decadeparent}}}|no||]}} | |||
# So invoke the new core | |||
{{#ifexpr: {{{1}}} < 100 | ] | ]}} | |||
⚫ | -->{{DisestcatCountry/core | ||
]</includeonly><!-- | |||
| year = {{{year|{{Title year}}}}} <!-- allow year param for demonstration purposes --> | |||
⚫ | # Note {{ |
||
| country = {{{1|}}} | |||
-->{{YearParamUsageCheck | |||
| sortkey = {{{2|}}} | |||
| decadeparent = {{{decadeparent|}}} | |||
⚫ | |||
| nocat={{{nocat|}}} | |||
⚫ | |||
| min={{{min|}}} | |||
| dab={{{dab|}}} | |||
⚫ | |||
}}<!-- | |||
⚫ | {{Documentation}} | ||
-->|<!-- | |||
# FOUND the old-style parameters | |||
</noinclude> | |||
# So issue an error warning | |||
-->{{error|ERROR! Unexpected numerical parameter in ]<br /><!-- | |||
-->Note that from September 2019, year parameters are not needed, and not supported}}<!-- | |||
# Tracking usage of old versions of the template | |||
-->{{Category other|]}}<!-- | |||
-->}}</includeonly><!-- | |||
⚫ | # Note {{CatAutoTOC}} needs to be available whether or not this template page has been transcluded | ||
-->{{CatAutoTOC}}<noinclude> | |||
⚫ | {{Documentation}}<!-- | ||
⚫ | Add categories and interwikis to the /doc subpage, please, not here! | ||
⚫ | --></noinclude> |
Latest revision as of 05:33, 10 May 2024
Template documentation[view] [edit] [history] [purge]This template is used on approximately 9,900 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
- {{DisestcatCountry}}
Usage
In September 2019, this template's syntax was changed to a new format which doesn't need year parameters. If used, they will now trigger an error message, and the page will be categorised in Category:Errors reported by establishment and disestablishment templates (population: 0) Purge page to update total
Syntax
{{DisestcatCountry| country }}
- Examples
{{DisestcatCountry|the United States|United States}} for Category:1993 disestablishments in the United States
{{DisestcatCountry|Belgium}} for Category:2007 disestablishments in Belgium
Change of country name
From 2015 to January 2022, this template took an optional parameter for a new name of the country. That parameter is now obsolete, as the template makes use of category redirects instead.
If the default parent category "Disestablishments in 'X' by year" is a category redirect page, the template will resolve the category redirect, i.e. it will use the target page with the new name instead. Similarly, it will resolve a redirect on the decade parent.
- Examples
The name Myanmar is used on all categories for 1989 onwards, and for any periods ending in or after that year, e.g. 1980s and 20th century.
For categories up to 1988, use the old name, i.e.
{{DisestcatCountry|Burma}}
On Category:1988 disestablishments in Burma, the template generates parent categories Category:1980s disestablishments in Myanmar and Category:Disestablishments in Myanmar by year, because both Category:1980s disestablishments in Burma and Category:Disestablishments in Burma by year are category redirects to the corresponding names using Myanmar.
On Category:1945 disestablishments in Burma, the parent categories will be Category:1940s disestablishments in Burma, which is not redirected, but Category:Disestablishments in Myanmar by year.
Suppressing parent category for decade
The template normally adds the page into a parent for the decade. In cases where that decade category does not exist, and it would not be useful to create it because of the short duration or small number of categories for this country, append |decadeparent=no
Disambiguation
If the country name used in the category title is ambiguous, use the optional named dab parameter to link to the mainspace article about the country.
- Example
{{DisestcatCountry|Malaya|dab=Malayan Union}}
Error checking
Error messages are display if this template is used in a which is not named "Category:YYYY disestablishments in Foo"
These errors are tracked in two tracking categories:
- Category:DisestcatCountry used in establishments category (0 pages) — where Template:DisestcatCountry has been used in a "Category:YYYY establishments in Foo"
- Category:DisestcatCountry used inappropriately (0 pages) — other misuses, including mis-spellings of "disestablishments"
See also
- Template:DisestcatCountryDecade
- Template:DisestcatCountryCentury
- Template:DisestcatCountry2ndMillennium
- Template:DisestcatCountry3rdMillennium
- Template:DisestcatContinent
- Template:Disestcatsubcountry (for subdivisions of countries, like states, provinces, departments; or regions of continents)
- Template:DisestcatUSstate
- Template:EstcatCountry
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template. Category: