This is the template sandbox page for Template:United States topic (diff). See also the companion subpage for test cases. |
This template is used on approximately 6,000 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.
Preview message: Transclusion count updated automatically (see documentation). |
This template allows for the quick creation of a navigational template for any group of articles which contains the names of the U.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 title List of airports in the United States and a body containing state names linked to List of airports in Alabama, List of airports in Alaska, etc.suffix = _National Guard
would create a title United States National Guard and a body containing state names linked to Alabama National Guard, Arizona National Guard, etc.prefix = Index of
and suffix = -related articles
would create a title Index of United States-related articles and a body containing state names linked to Index of Alabama-related articles, Index of Alaska-related articles, etc.autocollapse
, meaning that if there is another collapsible item on the page (a navbox, sidebar, or table 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 title Rivers in the United States.Tnavbar
. If set to plain
, the v • 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. Use off
to remove the v • 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 unnecessary red 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 Columbia
DC-text
can be combined with DC
to change both link and text, for example:|DC = District of Columbia |DC-text = District of Columbia
titlestyle = 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 the titlestyle to change the background color and the groupstyle 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 the liststyle parameter to add some extra padding around the list, the group1 parameter to remove the "States" heading, and the WA 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 an underscore 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 the DC 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 the group5 and list5 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 create Template: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 by Hospitals in the United States when this code is saved in Template:Hospitals in the United States.
Result: