Template:United States topic/doc

This template allows quick creation of navigational template for groups of articles containing names of U.S. states. It uses Template:Navbox to create the navigation box.

Mandatory

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

''One of the following combinations is needed to create the links:
 * prefix
 * Places text before the U.S. state name. For example:   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:   would create a title United States National Guard and a body containing state names linked to Alabama National Guard, Alaska National Guard, etc.


 * prefix and suffix
 * Places text before and after the U.S. state name. For example:   and   would create a title List of United States rivers and a body containing state names linked to List of Alabama rivers, List of Alaska rivers, etc.
 * Note: The title in this example should be replaced by using the title parameter described below.

Optional

 * state
 * A navbox with  will start out collapsed if there are two or more tables on the same page that use collapsible. If set to , the navbox will always start out in a collapsed state. If set to blank or anything other than   or  , the navbox will always start out in an expanded state.
 * Default is:.


 * 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:   generates the title Rivers in the United States.

Excluding groups
In some instances the District of Columbia, U.S. Territories (Insular Areas) or U.S. Minor Outlying Islands may not have their own articles on particular topics. To disable their inclusion in the template and avoid unnecessary red links, add any or all of the following parameters:


 * exclude-wdc
 * Set to any value this excludes display of the group named Federal District which links to Washington, D.C..


 * 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.

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


 * list5
 * Text or a list of links that is displayed below the state and territory links.


 * group5
 * Header text displayed in cell to left of text specified in list5.


 * above or top
 * A full-width cell (no group header) displayed above the template's body (between the title and U.S. state links).


 * below or bottom
 * A full-width cell (no group header) displayed below the template's body.

Change state name used in link
The link for the District of Columbia uses "Washington, D.C." and for the state of Georgia it is "Georgia (U.S. state)". The following parameters allow for substitution where the article name does not use the default


 * DC
 * Replace "Washington, D.C." in links with specified text, i.e. "District of Columbia" or "the District of Columbia".


 * GA
 * Replace "Georgia (U.S. state)" in links with specified text, i.e. "Georgia".

Styles

 * titlebkg or color
 * Background color for the title. Use of this parameter is discouraged. Where it is used, care and consensus are needed as multiple navigational templates on one page with different titlebar colors will probably look unpleasant.
 * Default is: #ccccff.
 * Default is: #ccccff.
 * Default is: #ccccff.


 * titlestyle
 * Specifies CSS values to apply to the title. This can also be used to set the background color of the title:


 * bodystyle or style
 * Specifies CSS values to apply to the template. This option should be used sparingly as it can lead to visual inconsistencies. Examples:
 * ...etc.
 * Default is:


 * groupstyle or group-style
 * Specifies CSS values to apply to the "group" cells. This option overrides any styles that are applied to the entire table. Examples:
 * ...etc.
 * Default is:


 * abovestyle or top-style
 * belowstyle or bottom-style
 * Specifies CSS values to apply to the cell specified via the above (or top) and below (or bottom) parameters. For instance:

Adding suffix without leading space
This example also shows the use of the style parameter to center text, the group1 parameter to remove the "States" heading, and the GA parameter to change link from "Georgia (U.S. state)" to "Georgia".

Adding suffix with leading space
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".

Using a suffix without a prefix
This example also shows use of the group5 and list5 parameters to add a group and list. {{United States topic


 * title  = National Guard in the United States
 * group5 = {{nowrap|Federal district and territories}}
 * list5  = District of Columbia{{·}} Puerto Rico{{·}} U.S. Virgin Islands

{{United States topic
 * suffix = _National Guard
 * GA = Georgia
 * exclude-wdc = y
 * exclude-ter = y
 * exclude-isl = y


 * state = uncollapsed
 * title  = National Guard in the United States
 * group5 = {{nowrap|Federal district and territories}}
 * list5  = District of Columbia{{·}} Puerto Rico{{·}} U.S. Virgin Islands

}}
 * suffix = _National Guard
 * GA = Georgia
 * exclude-wdc = y
 * exclude-ter = y
 * exclude-isl = y

Creating a new template
Code used to create Template:Hospitals in the United States:

Note:   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

 * 1) Template: All-US-interest
 * 2) Template: AmScoutbystate
 * 3) Template: History of slavery in the United States
 * 4) Template: Hospitals in the United States
 * 5) Template: Lists of colleges and universities in the United States
 * 6) Template: Lists of people by U.S. state
 * 7) Template: Lists of United States airports
 * 8) Template: NGbystate
 * 9) Template: Politics in the United States
 * 10) Template: Rivers in the United States
 * 11) Template: Superfund sites in the United States
 * 12) Template: U.S. political divisions histories
 * 13) Template: US ANG by state
 * 14) Template: US ARNG by state
 * 15) Template: US state seals
 * 16) Template: USPoliticalDivisions
 * 17) Template: USStateFlags