Lompat ke isi

Templat:Topik Amerika Serikat/doc

Dari Wikipedia bahasa Indonesia, ensiklopedia bebas

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.

Blank syntax

[sunting sumber]
{{Amerika Serikat
<!--sama seperti Templat:Navbox-->
|name       =
|state      =
|title      =
|titlestyle =
|bodystyle  =
|groupstyle =
<!--khusus untuk Templat:Amerika Serikat-->
|prefix =
|suffix =
|exclude-wdc =
|exclude-ter =
|exclude-isl =
}}

Parameters

[sunting sumber]

Mandatory

[sunting sumber]
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

[sunting sumber]
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
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 wikilinked. 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.

Excluding groups

[sunting sumber]

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

[sunting sumber]

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.
[sunting sumber]

Links for the District of Columbia use "Washington, D.C.", links for the state of Georgia use "Georgia (U.S. state)" and links for the state of New York use "New York". 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".
| DC = District of Columbia
GA
Replace "Georgia (U.S. state)" in links with specified text, i.e. "Georgia".
| GA = Georgia
NY
Replace "New York" in links with specified text, i.e. "New York State".
| NY = New York State
WA
Replace "Washington (U.S. state)" in links with specified text, i.e. "Washington".
| WA = Washington
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%;

Examples

[sunting sumber]

Changing the navbox title

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

Excluding display of federal district and minor outlying islands

[sunting sumber]

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.

{{Amerika Serikat
|title  = [[Daftar bandar udara di Amerika Serikat|Daftar bandar udara]] di [[Amerika Serikat]]
|titlestyle = background: #64E986;
|groupstyle = background: #6AFB92; vertical-align: top;
|prefix = Daftar bandar udara di
|WA = Washington
|exclude-wdc = y
|exclude-isl = y
}}

Adding suffix without leading space

[sunting sumber]

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 GA parameter to change link from "Georgia (U.S. state)" to "Georgia".

{{Amerika Serikat
|liststyle = padding: 5px 10px 5px 10px;
|group1 =
|prefix = List of
|suffix = -related topics
|GA = Georgia
|exclude-wdc = y
|exclude-ter = y
|exclude-isl = y
}}

Adding suffix with leading space

[sunting sumber]

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

{{Amerika Serikat
|title  = [[List of rivers of the United States|Rivers in the United States]]
|prefix = List of
|suffix = _rivers
|DC = District of Columbia
|WA = Washington
|exclude-isl = y
}}

Using a suffix without a prefix

[sunting sumber]

This example also shows use of the group5 and list5 parameters to add a group and list.

{{Amerika Serikat
<!--passed through to Template: Navbox -->
| title   = [[National Guard of the United States|National Guard]] in the [[United States]]
| group5  = {{nowrap|[[Federal district]]<br/>and [[insular area|territories]]}}
| 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
| GA = Georgia
| WA = Washington
| exclude-wdc = y
| exclude-ter = y
| exclude-isl = y

Membuat templat baru

[sunting sumber]

Kode yang digunakan untuk membuat Templat:RS di AS:

{{Amerika Serikat
<!--sama seperti Templat:Navbox-->
| name  = {{subst:PAGENAME}}
|title=[[Daftar rumah sakit di Amerika Serikat|Daftar rumah sakit]] di [[Amerika Serikat]]
<!--khusus untuk Templat:Amerika Serikat-->
| prefix = Daftar rumah sakit di
| WA = Washington
| exclude-ter = y
| exclude-isl = y
}}<noinclude>
[[Kategori:Templat menurut negara bagian di Amerika Serikat|{{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:

Templat yang menggunakan templat ini

[sunting sumber]
  1. Templat:Bandara di AS
  2. Templat:Bendera di AS
  3. Templat:Kota di AS
  4. Templat:RS di AS
  5. Templat:Sungai di AS

Lihat pula

[sunting sumber]
Tabel perbandingan templat menurut benua
Afrika Amerika Selatan Amerika Utara,
Tengah, dan Karibia
Asia Eropa Oseania D
Dunia {{Topik dunia}} · {{Benua}} · {{Bagian dunia}}
Generator {{Topik Afrika}} {{Topik Amerika Selatan}} {{Topik Amerika Utara}} {{Topik Asia}} {{Topik Eropa}} {{Topik Oseania}} D
Pengalihan {{Afrika}} {{Amerika Selatan}} {{Amerika Utara}} {{Asia}} {{Eropa}} {{Oseania}} D
"Negara di ..." {{...Afrika}} {{...Amerika Selatan}} {{...Amerika Utara}} {{...Asia}} {{...Eropa}} {{...Oseania}} D
"Bendera di ..." {{...Afrika}} {{...Amerika Selatan}} {{...Amerika Utara}} {{...Asia}} {{...Eropa}} {{...Oseania}} D
"Lambang negara di ..." {{...Afrika}} {{...Amerika Selatan}} {{...Amerika Utara}} {{...Asia}} {{...Eropa}} {{...Oseania}} D
"Daftar tokoh ..." {{...Afrika}} {{...Amerika Selatan}} {{...Amerika Utara}} {{...Asia}} {{...Eropa}} {{...Oseania}} D
"Sejarah ..." {{...Afrika}} {{...Amerika Selatan}} {{...Amerika Utara}} {{...Asia}} {{...Eropa}} {{...Oseania}} D
"Geografi ..." {{...Afrika}} {{...Amerika Selatan}} {{...Amerika Utara}} {{...Asia}} {{...Eropa}} {{...Oseania}} D
"Politik ..." {{...Afrika}} {{...Amerika Selatan}} {{...Amerika Utara}} {{...Asia}} {{...Eropa}} {{...Oseania}} D
"Kepala negara di ..." {{...Afrika}} {{...Amerika Selatan}} {{...Amerika Utara}} {{...Asia}} {{...Eropa}} {{...Oseania}} D
"Kepala pemerintahan di ..." {{...Afrika}} {{...Amerika Selatan}} {{...Amerika Utara}} {{...Asia}} {{...Eropa}} {{...Oseania}} D
"Wilayah Metropolitan di ..." {{...Afrika}} {{...Amerika Selatan}} {{...Amerika Utara}} {{...Asia}} {{...Eropa}} {{...Oseania}} D