Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Template:United States topic

Permanently protected template
From Wikipedia, the free encyclopedia
States
Federal district
Territories
Outlying islands
Template documentation[view] [edit] [history] [purge]
WarningThis template is used onapproximately 6,000 pages and changes may be widely noticed. Test changes in the template's/sandbox or/testcases subpages, or in your ownuser subpage. Consider discussing changes on thetalk page before implementing them.
Not to be confused withTemplate:United States topics.

This template allows for the quick creation of anavigational template for any group of articles which contains the names of theU.S. states. It uses{{Navbox}} to create the navigation box.

This template is intended for use only in Template space. It works differently from{{Asia topic}} and{{North America topic}}, despite the similar names.

Blank syntax

{{United States topic<!--passed through to Template:Navbox-->|name       =|state      =|title      =|titlestyle =|bodystyle  =|groupstyle =<!--specific to Template:United States topic-->|prefix =|suffix =|exclude-wdc =| exclude-ter =|exclude-isl =}}

Parameters

Mandatory

name
Mandatory when creating a new template (i.e.Template:Hospitals in the United States), otherwise the "view · talk · edit" links will connect toTemplate:United States topic. You can enter{{subst:PAGENAME}} for this value as a shortcut.

One of the following combinations is needed to create the links:

prefix
Text to be placed before the U.S. state name. The prefix text is always followed by a space. For example:prefix = List of airports in would create a titleList of airports in the United States and a body containing state names linked toList of airports in Alabama,List of airports in Alaska, etc.
Note: In instances when onlyprefix is specified, the template inserts "the" between the prefix text and "United States", creating the titleList of airports in the United States instead ofList of airports in United States. In the body it does the same for theNorthern Mariana Islands and theUnited States Virgin Islands.
suffix
Places text after the U.S. state name. For example:suffix = _National Guard would create a titleUnited States National Guard and a body containing state names linked toAlabama National Guard,Arizona National Guard, etc.
Note: Anunderscore is used in place of the leading space in the suffix. This is done to allow the use of suffixes without a leading space, as in the following example. A title should be specified to avoid the underscore appearing in the title.
prefixandsuffix
Places text before and after the U.S. state name. For example:prefix = Index of andsuffix = -related articles would create a titleIndex of United States-related articles and a body containing state names linked toIndex of Alabama-related articles,Index of Alaska-related articles, etc.

Optional

state
This template'sinitial visibility currently defaults toautocollapse, meaning that if there is another collapsible item on the page (anavbox, sidebar, ortable with the collapsible attribute), it is hidden apart from its title bar; if not, it is fully visible.

To change this template's initial visibility, the|state=parameter may be used:

  • {{United States topic|state=collapsed}} will show the template collapsed, i.e. hidden apart from its title bar.
  • {{United States topic|state=expanded}} will show the template expanded, i.e. fully visible.
title
Text that appears centered in the titlebar (the top bar). This is optional because the use of eitherprefix,suffix or both will automatically generate a title if thetitle parameter is not supplied. This parameter is not automaticallywiki-linked. For example:title = [[List of rivers of the United States|Rivers in the United States]] generates the titleRivers in the United States.
navbar*
Defaults toTnavbar. If set toplain, thev • d • e links on the left side of the titlebar will not be displayed, and padding will be automatically used to keep the title centered. Useoff to remove thev • d • e links, but not apply padding (this is for advanced use only; the "plain" option should suffice for most applications where a navbar is not desired). Note that it is highly recommended that one does not hide the navbar, in order to make it easier for users to edit the template, and to keep a standard style across pages.

Excluding groups

In some instances the District of Columbia, U.S. Territories (Insular Areas) or U.S. Minor Outlying Islands may not be relevant to or have their own articles on a particular topic. To disable their inclusion in the template and avoid unnecessaryred links, add any or all of the following parameters:

exclude-wdc
Set to any value this excludes display of the group namedFederal District which links toWashington, D.C..
exclude-ter
Set to any value this excludes display of the group namedTerritories (Insular Areas) which links toAmerican Samoa,Guam, etc.
exclude-isl
Set to any value this excludes display of the group namedOutlying Islands which links toBaker Island,Howland Island, etc.Note: even ifexclude-isl isnot set, links will not appear for pages that do not exist. If none of the pages in this group exist, the heading for the group will not appear either.

Adding groups and lists

Some templates may require a list of links not already included in the template. These can be specified as follows:

group5
Header text displayed in cell to left of text specified inlist5.
list5
Text or a list of links that is displayed below the state and territory links.
group6
Header text displayed in cell to left of text specified inlist6.
list6
Text or a list of links that is displayed below the state and territory links.
above
A full-width cell (no group header) displayedabove the template's body (between the title and U.S. state links).
below
A full-width cell (no group header) displayedbelow the template's body.

Change state name used in link

By default this template uses "Georgia (U.S. state)" for the state of Georgia, "New York (state)" for the state of New York, and "Washington (state)" for the state of Washington. Links for the District of Columbia use "Washington, D.C."

The following parameters allow for substitution where the article name does not use the default.

GA
Replace "Georgia (U.S. state)" in links with specified text, i.e. "Georgia".
|GA = Georgia
NY
Replace "New York (state)" in links with specified text, i.e. "New York".
|NY = New York
WA
Replace "Washington (state)" in links with specified text, i.e. "Washington".
|WA = Washington
DC
Replace "Washington, D.C." in links with specified text, i.e. "District of Columbia" or "the District of Columbia".
|DC = District of Columbia
DC-text
Replace "Washington, D.C." in the displayed text but not in the link.
|DC-text = District of Columbia
DC-text can be combined withDC to change both link and text, for example:
|DC = District of Columbia |DC-text = District of Columbia

Styles

titlestyle
SpecifiesCSS values to apply to the title. One use of this is to set the background color of the title:
titlestyle = background: #0000FF;
titlestyle = background: blue;
Default is:background: #ccccff;
bodystyle
Specifies CSS values to apply to the entire template. This will not override the following{{Navbox}} default styles:
abovestyle = background:#ddddff;
belowstyle = background:#ddddff;
groupstyle = background:#ddddff; text-align:right; white-space:nowrap;
liststyle = width:100%; font-size:95%;
abovestyle
belowstyle
Specifies CSS values to apply to the cell specified via theabove andbelow parameters. For instance:
belowstyle = border-top: #ccccff 1px solid;
Default is:background: #ddddff;
groupstyle
Specifies CSS values to apply to the cells specified via thegroupn cells. This option overrides any styles that are applied to the entire table. Example:
groupstyle = background:#6AFB92; vertical-align:top;
Default is:background: #ddddff; text-align:right; white-space:nowrap;
liststyle
Specifies CSS values to apply to the cells specified via thelistn cells. This option overrides any styles that are applied to the entire table. Examples:
liststyle = padding: 5px 10px 5px 10px;
Default is:width:100%; font-size:95%;

Examples

Changing the navbox title

{{United States topic|title=[[History of the United States]] by polity|prefix= History of|NY= New York}}

Excluding display of federal district and minor outlying islands

This example also shows the use of thetitlestyle to change the background color and thegroupstyle parameters to change the background color and vertical alignment of text.

{{United States topic|title=[[List of airports in the United States|Airports in the United States]]|titlestyle= background: #64E986;|groupstyle= background: #6AFB92; vertical-align: top;|prefix= List of airports in|exclude-wdc= y|exclude-isl= y|NY= New York|WA= Washington}}

Adding suffix without leading space

This example also shows the use of theliststyle parameter to add some extra padding around the list, thegroup1 parameter to remove the "States" heading, and theWA parameter to change link from "Washington (state)" to "Washington".

{{United States topic|liststyle= padding: 5px 10px 5px 10px;|group1=|prefix= Index of|suffix= -related articles|exclude-wdc= y|exclude-ter= y|exclude-isl= y|NY= New York|WA= Washington}}

Adding suffix with leading space

Note the use of anunderscore in place of the leading space in the suffix. This is done to accommodate the use of suffixes without a leading space, as in the previous example. A title should be specified to avoid the underscore appearing in the title. This example also uses theDC parameter to change link from "Washington, D.C." to "District of Columbia".

{{United States topic|title=[[List of rivers of the United States|Rivers in the United States]]|prefix= List of|suffix= _rivers|exclude-isl= y|DC= District of Columbia|NY= New York|WA= Washington}}

Using a suffix without a prefix

This example also shows use of thegroup5 andlist5 parameters to add a group and list.

{{United States topic<!--passed through to Template: Navbox -->|title  =[[National Guard of the United States]]|group5 = Other|list5  =*[[District of Columbia National Guard|District of Columbia]]*[[Puerto Rico National Guard|Puerto Rico]]*[[Virgin Islands National Guard|U.S.&nbsp;Virgin&nbsp;Islands]]<!-- specific to Template: United States topic -->|suffix = _National Guard|exclude-wdc = y|exclude-ter = y|exclude-isl = y|GA = Georgia|NY = New York|WA = Washington}}

Creating a new template

Code used to createTemplate:Hospitals in the United States:

{{United States topic<!--passed through to Template:Navbox-->|name  ={{subst:PAGENAME}}|title =[[List of hospitals in the United States|Hospitals in the United States]]<!--specific to Template:United States topic-->|prefix = List of hospitals in|exclude-ter = y|exclude-isl = y|NY = New York|WA = Washington}}<noinclude>[[Category:United States topic navigational boxes]]</noinclude>

Note:{{subst:PAGENAME}} in the above example would be replaced byHospitals in the United States when this code is saved inTemplate:Hospitals in the United States.

Result:

Templates implemented with United States topic

  1. Template:Alcohol laws of the United States
  2. Template:American wine
  3. Template:CAP
  4. Template:ClimateUS
  5. Template:Constitutions of the United States
  6. Template:CrimeUS
  7. Template:Flora of the United States by political division
  8. Template:Geology of the United States by political division
  9. Template:Governments of the United States
  10. Template:Grand Lodges in the United States
  11. Template:High schools in the United States
  12. Template:History of slavery in the United States
  13. Template:Hospitals in the United States
  14. Template:Judiciaries of the United States
  15. Template:Lakes in the United States
  16. Template:Law enforcement agencies of the United States by state
  17. Template:Law of the United States by state
  18. Template:LGBT history in the United States
  19. Template:Lists of amphibians by U.S. state
  20. Template:Lists of casinos by U.S. state
  21. Template:Lists of colleges and universities in the United States
  22. Template:Lists of companies by U.S. state
  23. Template:Lists of festivals by U.S. state
  24. Template:Lists of fossiliferous stratigraphic units in the United States
  25. Template:Lists of ghost towns by U.S. state
  26. Template:Lists of islands by U.S. state
  27. Template:Lists of lieutenant governors by U.S. state
  28. Template:Lists of mammals by U.S. state
  29. Template:Lists of mines in the United States
  30. Template:Lists of people by U.S. state
  31. Template:Lists of professional sports teams by U.S. state
  32. Template:Lists of reptiles by U.S. state
  33. Template:Lists of shopping malls by U.S. state
  34. Template:Lists of state forests by U.S. state
  35. Template:Lists of state parks by U.S. state
  36. Template:Lists of United States airports
  37. Template:Lists of United States breweries
  38. Template:Lists of US state agencies
  39. Template:Mountains of U.S. political divisions
  40. Template:Newspapers in the United States
  41. Template:Paleontology in the United States
  42. Template:Political party strength in U.S. states
  43. Template:Politics in the United States
  44. Template:Politics of the United States sidebar templates
  45. Template:Protected areas of the United States
  46. Template:Rivers in the United States
  47. Template:Scouting in the United States
  48. Template:Statutory codes of the United States by U.S. state
  49. Template:Superfund sites in the United States
  50. Template:Time in the United States
  51. Template:U.S. Counties
  52. Template:U.S. political divisions county courthouses
  53. Template:U.S. political divisions drug policy
  54. Template:U.S. political divisions education
  55. Template:U.S. political divisions electoral reform
  56. Template:U.S. political divisions geographies
  57. Template:U.S. political divisions histories
  58. Template:U.S. political divisions transportation
  59. Template:U.S. state templates
  60. Template:United States political divisions
  61. Template:United States school districts
  62. Template:US canals
  63. Template:US indexes
  64. Template:US outlines
  65. Template:US state flags
  66. Template:US state seals
  67. Template:Vehicle registration plates of the United States
Formerly implemented with United States topic
  1. Template:LGBT rights in the United States
  2. Template:Lighthouses in the United States
  3. Template:Museums in the US
  4. Template:Lists of settlements by U.S. state
  5. Template:Air National Guard
  6. Template:US National Guard by state

See also

World
Generator
Sovereign states and dependent territories...
List of...capitals
Regions of...
The abovedocumentation istranscluded fromTemplate:United States topic/doc.(edit |history)
Editors can experiment in this template'ssandbox(edit |diff) andtestcases(edit) pages.
Add categories to the/doc subpage.Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:United_States_topic&oldid=1330397706"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp