Templat:Topik Amerika Serikat/doc

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

Blank syntax

{{United States topic
<!-- passed through to Template:Navbox generic -->
|name   =
|state  = 
|title_style = background:
|title  = 
|style  = 
|group_style = 

<!-- specific to Template:United States topic -->
|prefix =
|suffix =
|exclude-wdc =
|exclude-ter =
|exclude-isl =
}}

Parameters

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 {{subst:PAGENAME}} 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: |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, Alaska National Guard, etc.
prefix and suffix
Places text before and after the U.S. state name. For example: |prefix = List of and |suffix = rivers 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 autocollapse will start out collapsed if there are two or more tables on the same page that use collapsible. If set to collapsed, the navbox will always start out in a collapsed state. If set to blank or anything other than autocollapse or collapsed, the navbox will always start out in an expanded state.
Default is: autocollapse.
title_style = background:
(or titlebkg = ) 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  background:#ccccff .
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 in the United States|Rivers in the United States]] generates the title Rivers in the United States.
style
Specifies CSS values to apply to the template. For instance:
text-align:[right|center|left|justified]; width:(em, %, px, auto); float:[left|right|none]; clear:[right|left|both|none]; margin:...etc.
This option should be used sparingly as it can lead to visual inconsistencies.
Default is: text-align:left;
group_style
Specifies CSS values to apply to the "group" cells. For instance:
background:#nnnnnn; text-align:[left|center|right]; vertical-align:[top|middle|bottom]...etc.
This option overrides any styles that are applied to the entire table.
Default is: text-align:center;

Excluding groups

In some instances the District of Columbia, U.S. Territories 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 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.

Examples

Changing the navigation box title

{{Amerika Serikat
|prefix = Daftar kota di
|title  = [[Daftar kota di Amerika Serikat]] menurut negara bagian
}}

Exclude display of federal district, territories or minor outlying islands

{{Amerika Serikat
|prefix = Bendera
|title  = [[Bendera Amerika Serikat]]
|image  = <!-- biarkan kosong -->
|exclude-wdc=y
|exclude-isl=y
}}
{{Amerika Serikat
|exclude-ter = y
|exclude-isl = y
|image  = 
}}

Creating a new template

Code used to create Template:Hospitals in the United States:

{{Amerika Serikat
| name  = {{subst:PAGENAME}}
| title = [[Daftar sungai di Amerika Serikat]]
| state  = uncollapsed
| prefix = Daftar sungai di
| exclude-ter = y
| exclude-isl = y
| image  = 
}}<noinclude>
[[Category:United States topic navigational boxes|{{PAGENAME}}]]
</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

  1. Templat:List of United States airports
  2. Templat:Lists of people by U.S. state
  3. Templat:Lists of cities by U.S. state
  4. Templat:Lists of colleges and universities in the United States
  5. Templat:Lists of state parks by U.S. state
  6. Templat:Political party strength in U.S. states
  7. Templat:Vehicle registration plates of the United States
  8. Templat:Hospitals in the United States
  9. Templat:Rivers in the United States
  10. Templat:U.S. political divisions histories
  11. Templat:U.S. political divisions geographies
  12. Templat:U.S. political divisions governments
  13. Templat:U.S. state templates
  14. Templat:US state flags
  15. Templat:US state seals
  16. Templat:USPoliticalDivisions