| This 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. |
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.
{{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 =}}
{{subst:PAGENAME}} for this value as a shortcut.One of the following combinations is needed to create the links:
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.suffix = _National Guard would create a titleUnited States National Guard and a body containing state names linked toAlabama National Guard,Arizona National Guard, etc.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.autocollapse, 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 = [[List of rivers of the United States|Rivers in the United States]] generates the titleRivers in the United States.Tnavbar. 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.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:
Some templates may require a list of links not already included in the template. These can be specified as follows:
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 = Georgia|NY = New York|WA = Washington|DC = District of Columbia|DC-text = District of ColumbiaDC-text can be combined withDC to change both link and text, for example:|DC = District of Columbia |DC-text = District of Columbiatitlestyle = background: #0000FF;titlestyle = background: blue;background: #ccccff;abovestyle = background:#ddddff;belowstyle = background:#ddddff;groupstyle = background:#ddddff; text-align:right; white-space:nowrap;liststyle = width:100%; font-size:95%;belowstyle = border-top: #ccccff 1px solid;background: #ddddff;groupstyle = background:#6AFB92; vertical-align:top;background: #ddddff; text-align:right; white-space:nowrap;liststyle = padding: 5px 10px 5px 10px;width:100%; font-size:95%;{{United States topic|title=[[History of the United States]] by polity|prefix= History of|NY= New York}}
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}}
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}}
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}}
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. Virgin 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}}
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: