Template:Countries of the United Kingdom/sandbox

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

{{Constituent countries of the United Kingdom|prefix=:Namespace:Prefix text|suffix=suffix text}}

Template parameters

Parameter Description Default Status
prefixText inserted before the English country name for each link.emptyoptional
suffixText added after the English country name for each link.emptyoptional
sepSeparator between prefix and name, and between name and suffix.spaceoptional
simpleFor 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).emptyoptional
showcodeUse |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.emptyoptional
allUse |all=yes for a temporary test to show all links without testing for their existence; will show red links.emptyoptional
nocatUse |nocat=yes for a demonstration where a template with invalid parameters should not output a tracking category.emptyoptional


Templates and country data

The following templates are implemented by Module:Countries:

Template Data module Examples and test cases
{{Countries of Africa}}Module:Countries/Africatestcases
{{Countries of the Americas}}Module:Countries/Americastestcases
{{Countries of the Arab world}}Module:Countries/Arab worldtestcases
{{Countries of Asia}}Module:Countries/Asiatestcases
{{Countries of the Caribbean}}Module:Countries/Caribbeantestcases
{{Countries of Central America}}Module:Countries/Central Americatestcases
{{Countries of Europe}}Module:Countries/Europetestcases
{{Countries of the European Union}}Module:Countries/European Uniontestcases
{{Countries of North America}}Module:Countries/North Americatestcases
{{Countries of North America (subcontinent)}}Module:Countries/North America (subcontinent)testcases
{{Countries of Oceania}}Module:Countries/Oceaniatestcases
{{Countries of South America}}Module:Countries/South Americatestcases
{{Olympic teams}}Module:Countries/Olympic teamstestcases
{{Constituent countries of the United Kingdom}}Module:Countries/United Kingdomtestcases
{{States of the United States}}Module:States of the United Statestestcases
{{Departments of France}}Module:Departments of Francetestcases
{{Regions of France}}Module:Regions of Francetestcases

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:

Sandbox template Sandbox data module
{{Countries of Africa/sandbox}}Module:Countries/Africa/sandbox
{{Countries of the Americas/sandbox}}Module:Countries/Americas/sandbox
{{Countries of the Arab world/sandbox}}Module:Countries/Arab world/sandbox
{{Countries of Asia/sandbox}}Module:Countries/Asia/sandbox
{{Countries of the Caribbean/sandbox}}Module:Countries/Caribbean/sandbox
{{Countries of Central America/sandbox}}Module:Countries/Central America/sandbox
{{Countries of Europe/sandbox}}Module:Countries/Europe/sandbox
{{Countries of the European Union/sandbox}}Module:Countries/European Union/sandbox
{{Countries of North America/sandbox}}Module:Countries/North America/sandbox
{{Countries of North America (subcontinent)/sandbox}}Module:Countries/North America (subcontinent)/sandbox
{{Countries of Oceania/sandbox}}Module:Countries/Oceania/sandbox
{{Countries of South America/sandbox}}Module:Countries/South America/sandbox
{{Olympic teams/sandbox}}Module:Countries/Olympic teams/sandbox
{{Constituent countries of the United Kingdom/sandbox}}Module:Countries/United Kingdom/sandbox
{{States of the United States/sandbox}}Module:States of the United States/sandbox
{{Departments of France/sandbox}}Module:Departments of France/sandbox
{{Regions of France/sandbox}}Module:Regions of France/sandbox

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.

  • {{Constituent countries of the United Kingdom/sandbox|prefix=:Category:}}
  • {{Constituent countries of the United Kingdom|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

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).

{{Constituent countries of the United Kingdom|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.

Template parameters

ParameterDescriptionTypeStatus
prefixprefix

Text inserted before the English country name for each link.

Lineoptional
suffixsuffix

Text added after the English country name for each link.

Lineoptional
sepsep

Separator between prefix and name, and between name and suffix.

Lineoptional
simplesimple

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).

Lineoptional
showcodeshowcode

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.

Lineoptional
allall

Use all=yes for a temporary test to show all links without testing for their existence; will show red links.

Lineoptional
nocatnocat

Use nocat=yes for a demonstration where a template with invalid parameters should not output a tracking category.

Lineoptional
Category:Category navigational templates for the United Kingdom#Countries