Template:Infobox former country/autocat: Difference between revisions
Jump to navigation
Jump to search
Template documentation
m 1 revision imported |
No edit summary |
||
| Line 19: | Line 19: | ||
|Caribbean = [[Category:Former countries in the Caribbean|{{{common_name}}}, {{{year_start}}}]] | |Caribbean = [[Category:Former countries in the Caribbean|{{{common_name}}}, {{{year_start}}}]] | ||
|#default = {{#switch:{{ucfirst:{{{continent}}}}} | |#default = {{#switch:{{ucfirst:{{{continent}}}}} | ||
|Africa|Asia|Europe|North America|South America = [[Category:Former countries in {{{continent}}}|{{{common_name}}}, {{{year_start}}}]] | |Africa|Asia|Europe|North America|South America|United Nations = [[Category:Former countries in {{{continent}}}|{{{common_name}}}, {{{year_start}}}]] | ||
|Australia|Oceania = [[Category:Former countries in Oceania|{{{common_name}}}, {{{year_start}}}]] | |Australia|Oceania = [[Category:Former countries in Oceania|{{{common_name}}}, {{{year_start}}}]] | ||
|Asia, Europe|Eurasia = [[Category:Former countries in Europe|{{{common_name}}}, {{{year_start}}}]][[Category:Former countries in Asia|{{{common_name}}}, {{{year_start}}}]] | |Asia, Europe|Eurasia = [[Category:Former countries in Europe|{{{common_name}}}, {{{year_start}}}]][[Category:Former countries in Asia|{{{common_name}}}, {{{year_start}}}]] | ||
Revision as of 21:01, 13 June 2018
This subtemplate of {{Infobox former country}} is used to automatically add categories to articles which transclude this template. It should not be used directly
Establishment dates
- First the template tests to see if "Category:States and territories established in the {{{year_start}}}" exists. If so, it is added.
- If not, the template tests to see if "Category:States and territories established in {{{year_start}}}" exists. If so, it is added.
- If not, the template tests to see if "Category:States and territories established in the DECADEs" where DECADE is the decade containing {{{year_start}}} (e.g. Category:States and territories established in the 110s). If so, it is added.
- If not, the template tests to see if "Category:States and territories established in the Nth century" where N is the century containing {{{year_start}}} (e.g. Category:States and territories established in the 1st century BC). If so, it is added.
The reason for the first case is in case an imprecise date is entered, such as "the 820s" or "the 18th century", before trying exact dates like "1820".
Disestablishment dates
- First the template tests to see if "Category:States and territories disestablished in the {{{year_end}}}" exists. If so, it is added.
- If not, the template tests to see if "Category:States and territories disestablished in {{{year_end}}}" exists. If so, it is added.
- If not, the template tests to see if "Category:States and territories disestablished in the DECADEs" where DECADE is the decade containing {{{year_end}}} (e.g. Category:States and territories disestablished in the 530s). If so, it is added.
- If not, the template tests to see if "Category:States and territories disestablished in the Nth century" where N is the century containing {{{year_end}}} (e.g. Category:States and territories disestablished in the 1st century BC). If so, it is added.
The reason for the first case is in case an imprecise date is entered, such as "the 820s" or "the 18th century", before trying exact dates like "1820".