Template:United States topic/doc

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 to create the navigation box.

Mandatory

 * 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  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:   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, 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:   and   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.

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.


 * navbar *
 * Defaults to . If set to , 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   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.

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

Links in the last of these groups will only appear if the pages exist.

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
 * 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
By default this template uses "Georgia (U.S. state)" for the state of Georgia, "New York" 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".


 * NY
 * Replace "New York" in links with specified text, i.e. "New York State".


 * WA
 * Replace "Washington (state)" in links with specified text, i.e. "Washington".


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

Styles

 * titlestyle
 * Specifies CSS values to apply to the title. One use of this is to set the background color of the title:
 * Default is:
 * Default is:
 * Default is:


 * bodystyle
 * Specifies CSS values to apply to the entire template. This will not override the following Navbox default styles:


 * abovestyle
 * belowstyle
 * Specifies CSS values to apply to the cell specified via the above and below parameters. For instance:
 * Default is:
 * Default is:


 * 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:
 * Default is:
 * Default is:


 * 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:
 * Default is:
 * Default is:

Excluding display of federal district and minor outlying islands
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.

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

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 = Other
 * list5  =
 * District of Columbia
 * Puerto Rico
 * U.S. Virgin Islands

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


 * state = uncollapsed
 * title  = National Guard in the United States
 * group5 = Other
 * list5  =
 * District of Columbia
 * Puerto Rico
 * U.S. Virgin Islands

}}
 * suffix = _National Guard
 * GA = Georgia
 * WA = Washington
 * 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: Alcohol Policy in the United States
 * 2) Template: CAP
 * 3) Template: ClimateUS
 * 4) Template: CrimeUS
 * 5) Template: FrogsAndToadsByState
 * 6) Template: Grand Lodges in the United States
 * 7) Template: High schools in the United States
 * 8) Template: History of slavery in the United States
 * 9) Template: Hospitals in the United States
 * 10) Template: Lakes in the United States
 * 11) Template: LawByState
 * 12) Template: LGBT history in the United States
 * 13) Template: Lighthouses in the United States
 * 14) Template: Lists of casinos by U.S. state
 * 15) Template: Lists of colleges and universities in the United States
 * 16) Template: Lists of companies by U.S. state
 * 17) Template: Lists of museums in the United States
 * 18) Template: Lists of people by U.S. state
 * 19) Template: Lists of state forests by U.S. state
 * 20) Template: Lists of state parks by U.S. state
 * 21) Template: Lists of United States airports
 * 22) Template: Lists of US state agencies
 * 23) Template: Newspapers in the United States
 * 24) Template: Political party strength in U.S. states
 * 25) Template: Politics in the United States
 * 26) Template: Politics of the United States sidebar templates
 * 27) Template: Protected Areas of the United States
 * 28) Template: Rivers in the United States
 * 29) Template: Scouting in the United States
 * 30) Template: State Law in the United States
 * 31) Template: Superfund sites in the United States
 * 32) Template: U.S. political divisions county courthouses
 * 33) Template: U.S. political divisions drug policy
 * 34) Template: U.S. political divisions education
 * 35) Template: U.S. political divisions electoral reform
 * 36) Template: U.S. political divisions geographies
 * 37) Template: U.S. political divisions governments
 * 38) Template: U.S. political divisions histories
 * 39) Template: U.S. political divisions transportation
 * 40) Template: U.S. state templates
 * 41) Template: US outlines
 * 42) Template: US state flags
 * 43) Template: US state seals
 * 44) Template: United States political divisions
 * 45) Template: Vehicle registration plates of the United States


 * Formerly implemented with United States topic
 * 1) Template: All-US-interest
 * 2) Template: LGBT rights in the United States
 * 3) Template: Lists of cities by U.S. state
 * 4) Template: NGbystate
 * 5) Template: US ANG by state
 * 6) Template: US ARNG by state