Template:Countries of the Americas
Other areas: Anguilla · Aruba · Bermuda · British Virgin Islands · Cayman Islands · Curaçao · Dutch Caribbean · Falkland Islands · French Guiana · Greenland · Guadeloupe · Martinique · Montserrat · Puerto Rico · Saint Barthélemy · Saint-Martin · Saint Pierre and Miquelon · Sint Maarten · South Georgia and the South Sandwich Islands · Turks and Caicos Islands · United States Virgin Islands
This documentation is transcluded from Template:Countries of Africa/doc.
Displays a navigation box with links to similar galleries or categories for every country in a region. Links to existing pages are displayed using country names in the current user's language. Country names are obtained from Wikidata. If the name of a country is incorrect, find the country in this list and use the link in the Item column to check what changes have occurred at Wikidata.
Usage
[edit]{{Countries of the Americas|prefix=:Namespace:Prefix text|suffix=suffix text}}
Template parameters
[edit]Parameter | Description | Default | Status |
---|---|---|---|
prefix |
Text inserted before the English country name for each link. | empty | optional |
suffix |
Text added after the English country name for each link. | empty | optional |
sep |
Separator between prefix and name, and between name and suffix. | space | optional |
simple |
For some templates, |simple=yes simplifies the output, omitting some sections (e.g. for smaller or special territories, but possibly adding some of them in another displayed section). |
empty | optional |
showcode |
Use |showcode=yes to also display the country/territory code (between square brackets) after each linked label. The codes displayed are those defined in the data module. |
empty | optional |
all |
Use |all=yes for a temporary test to show all links without testing for their existence; will show red links. |
empty | optional |
nocat |
Use |nocat=yes for a demonstration where a template with invalid parameters should not output a tracking category. |
empty | optional |
Templates and country data
[edit]The following templates are implemented by Module:Countries:
For example, {{Countries of Africa}} contains:
{{#invoke:Countries|main|Africa}}
The parameter Africa
means data from Module:Countries/Africa is used. Changes to the countries or the text displayed are made in the data module.
Before updating the main data module, changes should be made in the sandbox data module and tested with the sandbox template:
For example {{Countries of Africa/sandbox}} just contains:
{{#invoke:Countries/sandbox|main|Africa}}
And it uses the sandbox version of the associated data module, used by Module:Countries/sandbox (which is the sandbox version of Module:Countries).
Displaying the sandbox version of a template also allows testing changes in Module:Countries, without modifying the template or its associated data module (which don't need to be changed in their sandbox version).
The following two examples below allow testing changes made in the sandbox before applying working modifications to the normal version. This should work as intended and will finally display the same thing between the normal and sandbox versions of the template (and of their associated data module) once these versions are synchronized.
{{Countries of the Americas/sandbox|prefix=:Category:}}
{{Countries of the Americas|prefix=:Category:}}
See more examples in the testcases listed above for the normal version with their rendering to compare the results in the sandbox version.
Errors
[edit]If an invalid parameter is used, an error message is displayed when an edit to the page is previewed. If a page with an error is saved, no message is displayed but the page is added to a hidden error tracking category: Category:Countries template with invalid parameters.
For example the following code misspells the expected suffix
parameter (For this demonstration, no tracking category is added because |nocat=yes
is used).
{{Countries of the Americas|prefix=:Category:Maps of|sufix=by region|nocat=yes}}
Previewing an edit on any category or gallery page, with such code added (not on this documentation page!) shows the result and the following message Error: invalid parameter "|sufix=by region" will appear. You can fix it by editing the code in your edited page.
No description.
Parameter | Description | Type | Status | |
---|---|---|---|---|
prefix | prefix | Text inserted before the English country name for each link. | Line | optional |
suffix | suffix | Text added after the English country name for each link. | Line | optional |
sep | sep | Separator between prefix and name, and between name and suffix. | Line | optional |
simple | simple | For some templates, simple=yes simplifies the output, omitting some sections (e.g. for smaller or special territories, but possibly adding some of them in another displayed section). | Line | optional |
showcode | showcode | Use showcode=yes to also display the country/territory code (between square brackets) after each linked label. The codes displayed are those defined in the data module. | Line | optional |
all | all | Use all=yes for a temporary test to show all links without testing for their existence; will show red links. | Line | optional |
nocat | nocat | Use nocat=yes for a demonstration where a template with invalid parameters should not output a tracking category. | Line | optional |