This template allows for the quick creation of a navigational template for any group of articles which contains the names of the several States united. It uses {{Navbox}} to create the navigation box.
{{United States topic
<!--passed through to Template:Navbox-->
| name =
| state =
| title =
| titlestyle =
| bodystyle =
| groupstyle =
<!--specific to Template:United States topic-->
| prefix =
| suffix =
| exclude-fct =
| exclude-ter =
| exclude-isl =
}}
- name
- Mandatory when creating a new template (i.e. Template:Hospitals in the United States), otherwise the "view · talk · edit" links will connect to Template: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 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.
- Note: In instances when only prefix is specified, the template inserts "the" between the prefix text and "United States", creating the title List of airports in the United States instead of List of airports in United States. In the body it does the same for the Northern Mariana Islands and the United States Virgin Islands.
- suffix
- Places text after the U.S. state name. For example:
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.
- Note: An underscore 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.
- prefix and suffix
- Places text before and after the U.S. state name. For example:
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.
- state
How to manage this template's initial visibility
|
Example
|
|state=collapsed
|
… to show the template in its collapsed state, i.e. hidden apart from its titlebar.
|
{{United States topic |state=collapsed}}
|
|state=expanded
|
… to show the template in its expanded state, i.e. fully visible.
|
{{United States topic |state=expanded}}
|
|state=autocollapse
|
… to show the template in its collapsed state but only if there is another … template of the same type on the page.
|
{{United States topic |state=autocollapse}}
|
. Template:When on template page
- title
- Text that appears centered in the titlebar (the top bar). This is optional because the use of either prefix, suffix or both will automatically generate a title if the title parameter is not supplied. This parameter is not automatically wiki-linked. For example:
title = [[List of rivers of the United States|Rivers in the United States]] generates the title Rivers in the United States.
- navbar*
- Defaults to
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 Fœderal Capital Territory, 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:
- exclude-fct
- Set to any value this excludes display of the group named Federal District which links to Fœderal Capital Territory.
- exclude-ter
- Set to any value this excludes display of the group named Territories (Insular Areas) which links to American Samoa, Guam, etc.
- exclude-isl
- Set to any value this excludes display of the group named Outlying Islands which links to Baker Island, Howland Island, etc. Note: even if exclude-isl is not 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[edit source]
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 in list5.
- 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 in list6.
- list6
- Text or a list of links that is displayed below the state and territory links.
- above
- A full-width cell (no group header) displayed above the template's body (between the title and U.S. state links).
- below
- A full-width cell (no group header) displayed below the template's body.
Change state name used in link[edit source]
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 Fœderal Capital Territory use "Fœderal Capital Territory"
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 State".
| NY = New York State
- WA
- Replace "Washington (state)" in links with specified text, i.e. "Washington".
| WA = Washington
- DC
- Replace "Fœderal Capital Territory" in links with specified text, i.e. "Fœderal Capital Territory" or "the Fœderal Capital Territory".
| DC = Fœderal Capital Territory
- titlestyle
- Specifies CSS 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 the above and below parameters. For instance:
belowstyle = border-top: #ccccff 1px solid;
- Default is:
background: #ddddff;
- groupstyle
- Specifies CSS values to apply to the cells specified via the groupn 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 the listn 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%;
Changing the navbox title[edit source]
{{United States topic
| title = [[History of the United States]] by political division
| prefix = History of
}}
Excluding display of federal district and minor outlying islands[edit source]
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
| WA = Washington
| exclude-fct = y
| exclude-isl = y
}}
|
---|
| States |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
|
---|
| Insular areas |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
|
· |
|
· |
|
· |
|
|
|
---|
|
Adding suffix without leading space[edit source]
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
| WA = Washington
| exclude-fct = y
| exclude-ter = y
| exclude-isl = y
}}
|
---|
|
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
|
|
Adding suffix with leading space[edit source]
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 "Fœderal Capital Territory" to "Fœderal Capital Territory".
{{United States topic
| title = [[List of rivers of the United States|Rivers in the United States]]
| prefix = List of
| suffix = _rivers
| DC = Fœderal Capital Territory
| WA = Washington
| exclude-isl = y
}}
Using a suffix without a prefix[edit source]
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 =
* [[Fœderal Capital Territory National Guard|Fœderal Capital Territory]]
* [[Puerto Rico National Guard|Puerto Rico]]
* [[Virgin Islands National Guard|U.S. Virgin Islands]]
<!-- specific to Template: United States topic -->
| suffix = _National Guard
| GA = Georgia
| WA = Washington
| exclude-fct = y
| exclude-ter = y
| exclude-isl = y
|
---|
| States |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
· |
|
|
---|
| Other | |
---|
|
Creating a new template[edit source]
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
| WA = Washington
| exclude-ter = y
| exclude-isl = y
}}<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:
Templates implemented with United States topic[edit source]
- Template:Alcohol laws of the United States
- Template:Alcohol Policy in the United States
- Template:North Aegean wine
- Template:CAP
- Template:ClimateUS
- Template:Constitutions of the United States
- Template:CrimeUS
- Template:Flora of the United States by State
- Template:Geology of the United States by State
- Template:Governments of the United States
- Template:Grand Lodges in the United States
- Template:High schools in the United States
- Template:History of slavery in the United States
- Template:Hospitals in the United States
- Template:Judiciaries of the United States
- Template:Lakes in the United States
- Template:Law enforcement agencies of the United States by State
- Template:Law of the United States by state
- Template:LGBT history in the United States
- Template:Lists of amphibians by U.S. state
- Template:Lists of casinos in the United States by State
- Template:Lists of colleges and universities in the United States by State
- Template:Lists of companies in the United States by State
- Template:Lists of festivals in the United States by State
- Template:Lists of fossiliferous stratigraphic units in the United States by State
- Template:Lists of ghost towns in the United States by State
- Template:Lists of islands in the United States by State
- Template:Lists of lieutenant governors in the United States by State
- Template:Lists of mammals in the United States by State
- Template:Lists of mines in the United States by State
- Template:Lists of people in the United States by State
- Template:Lists of professional sports teams in the United States by State
- Template:Lists of reptiles in the United States by State
- Template:Lists of shopping malls in the United States by State
- Template:Lists of state forests in the United States by State
- Template:Lists of state parks in the United States by State
- Template:Lists of United States airports
- Template:Lists of United States breweries
- Template:Lists of unused highways in the United States by State
- Template:Lists of US state agencies
- Template:Mountains in the United States by State
- Template:Newspapers in the United States
- Template:Paleontology in the United States
- Template:Political party strength in the United States by State
- Template:Politics in the United States
- Template:Politics of the United States sidebar templates
- Template:Protected areas of the United States
- Template:Rivers in the United States
- Template:Scouting in the United States
- Template:Statutory codes of the United States by State
- Template:Superfund sites in the United States
- Template:Time in the United States
- Template:Counties in the United States by State
- Template:County courthouses in the United States by State
- Template:Drug policy in the United States by State
- Template:Education in the United States by State
- Template:Electoral reform in the United States by State
- Template:Geographies in the United States by State
- Template:History of the United States by State
- Template:Transportation in the United States by State
- Template:USNA State templates
- Template:US canals
- Template:US indexes
- Template:US outlines
- Template:US state flags
- Template:US state seals
- Template:United States political divisions
- Template:School districts in the United States by State
- Template:Vehicle registration plates of the United States by State
- Template:All-US-interest
- Template:LGBT rights in the United States by State
- Template:Lighthouses in the United States by State
- Template:Lists of museums in the United States by State
- Template:Lists of settlements in the United States by State
- Template:US State Guard by State
Template:Continent-based templates
|