Template:North America topic/sandbox
This is the template sandbox page for Template:North America topic (diff). |
This template uses Lua: |
This template is used on approximately 3,700 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. |
General documentation on continent-topic templates
[edit]The continent/region-topic templates allow quick creation of a navigational template for groups of articles about a common topic in different countries of a continent/region. It uses Template:Navbox to create the navigation box.
The lists of countries included in the "Continent topic" templates are broadly those found in the "Countries of" templates. Discussions on which countries to include are best conducted on the talk pages of these latter templates.
For example, Oceania generally includes Australia and the nations of the Pacific and islands in the Pacific Ocean that have closer ties to Asia or the Americas are usually grouped accordingly.
Usage
[edit]1st parameter (prefix)
[edit]The most basic usage of template is with a single unnamed parameter in the format {{Continent/region topic |Topic [of/in]}}
, replacing Continent/region with the name of a continent or region and Topic with the name of a topic followed by "of" or "in". For example, {{Africa topic |Geography of}}
generates a navigation box titled "Geography of Africa" with a list of country names linked to articles such as Geography of Angola, etc.
- Code
{{Africa topic |Geography of}}
- Result
The named parameter prefix can be used in place of the unnamed 1st parameter.
- Code
{{Asia topic |prefix=Geography of}}
- Result
2nd parameter (suffix)
[edit]The template accepts a second unnamed parameter for text to be placed after the country name. There is no space between the country name and the suffix, to allow for links to articles such as List of Spain-related topics.
- Code
{{Europe topic |List of |-related topics}}
- Result
An underscore can be used to place a space between the country name and the text:
- Code
{{North America topic |List of basic | topics}}
- Result
Note that in the above example the links work but the underscore is displayed in the title. This can be fixed by specifying a title (see next section) or by using the named parameter suffix which always places a space between the country name and text.
- Code
{{South America topic |prefix=List of basic |suffix=topics}}
- Result
Changing the title
[edit]The title parameter is used to specify text which appears in the title bar at the top of the navigation box. This is optional because the use of prefix, suffix or both will automatically generate a title, as shown in the previous examples. This title is not automatically wiki-linked, so add brackets as needed.
The following shows a navigation box with links to articles such as Flag of Australia, but replaces the default title "Flag of Oceania" with the specified title "Flags of Oceania".
- Code
{{Oceania topic |Flag of |title=[[Flags of Oceania]]}}
- Result
Displaying template in show mode
[edit]These navigation boxes are set to autocollapse
when there is more than one on a page. To force it into collapsed or expanded mode use the state parameter. If set to collapsed
, the navbox will always start out in a collapsed state. If set to blank or anything other than autocollapse
or collapsed
, the navbox will always start out in an expanded state.
- Code
{{Africa topic |prefix=Geography of |state=expand}}
- Result
Disabling dependencies and other territories
[edit]Not all dependencies or similar territories have their own articles on particular topics. To disable the inclusion of such territories in a template (that would otherwise appear as red links), include the parameter "countries_only=yes".
- Code
{{Europe topic |prefix=Islam in |state=expanded |countries_only=yes}}
- Result
Creating a new template
[edit]Although these templates can be used in an article, they can also be used to create a new template. The name parameter is mandatory when creating a new template, because it allows the "V T E" links to work properly. The following example shows code that could be used to create Template:Flags of Europe.
{{Europe topic
| name = Flags of Europe
| state = {{{state|{{{1|}}}}}}
| title = [[Flags of Europe]]
| prefix = Flag of
}}<noinclude>
[[Category:Europe templates]]
</noinclude>
The template can then be added to articles using {{Flags of Europe}}
or {{Flags of Europe |state=expand}}
.
When to use the templates
[edit]- Before implementing these templates in a topic, check for red links. If there are several red links, consider whether a separate article in the topic for each country is warranted.
- Some topics may use a different navigational scheme. In general, don't use this template if there are already navigational templates in several of the articles of a topic.
Examples of appropriate articles for these templates are {{Africa topic |Culture of}} or {{North America topic |List of airports in}}, both of which have a number of blue links, and where the majority of red links could have a reasonable article written about them.
Examples of inappropriate articles for these templates are {{North America topic |Maya in}}, where articles could only be written for a small number of nations and {{Oceania topic |Music of}}, where articles already have templates which use a different navigational scheme.
Redirects
[edit]When there are a small number of links for which an article is not appropriate, consider making a redirect to the broader article in which the topic is included. For example, Hinduism in Cambodia redirects to Hinduism in Southeast Asia and Geography of Christmas Island redirects to Christmas Island#Geography.
Notes
[edit]Navigational templates are usually placed at the end of an article.
List of wrapper templates using Template:North America topic
[edit]- {{Abortion in North America}}
- {{Association football in North America}}
- {{Capitals in North America}}
- {{Coats of arms of North America}}
- {{Culture of North America templates}}
- {{Education in North America}}
- {{Flags of North America}}
- {{Geography of North America}}
- {{History of North America by country}}
- {{History of North America templates}}
- {{Judiciaries of North America}}
- {{Lists of schools in North America}}
- {{Mountain peaks of North America}}
- {{Politics of North America templates}}
- {{Sport deaths in North America (category)}}
- {{Television in North America}}
- {{Tourism in North America}}
- {{Women in North America}}
- {{Women's association football in North America}}
See also
[edit]
Data table
Code | Display name [link name] | Switch | Hidden? |
---|---|---|---|
Sovereign states | |||
AG | Antigua and Barbuda | ||
BS | Bahamas [the] | ||
BB | Barbados | ||
BZ | Belize | ||
CA | Canada | ||
CR | Costa Rica | ||
CU | Cuba | ||
DM | Dominica | ||
DO | Dominican Republic [the] | ||
SV | El Salvador | ||
GD | Grenada | ||
GT | Guatemala | ||
HT | Haiti | ||
HN | Honduras | ||
JM | Jamaica | ||
MX | Mexico | ||
NI | Nicaragua | ||
PA | Panama | ||
KN | Saint Kitts and Nevis | ||
LC | Saint Lucia | ||
VC | Saint Vincent and the Grenadines | ||
TT | Trinidad and Tobago | ||
US | United States [the] | ||
Dependencies and other territories | countries_only | ||
AI | Anguilla | ||
AW | Aruba | ||
BM | Bermuda | ||
XBO | Bonaire | ||
VG | British Virgin Islands [the] | ||
KY | Cayman Islands [the] | ||
CW | Curaçao | ||
GL | Greenland | ||
GP | Guadeloupe | ||
MQ | Martinique | ||
MS | Montserrat | ||
XNV | Navassa Island | Depends on existence | |
PR | Puerto Rico | ||
BL | Saint Barthélemy | ||
MF | Saint Martin [the Collectivity of Saint Martin] | ||
PM | Saint Pierre and Miquelon | ||
XSA | Saba | ||
XSE | Sint Eustatius | ||
SX | Sint Maarten | ||
TC | Turks and Caicos Islands [the] | ||
VI | United States Virgin Islands [the] |