Templat:Topik Amerika Serikat/doc: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
k +terjemah |
interwiki to WikiData only |
||
(15 revisi perantara oleh 6 pengguna tidak ditampilkan) | |||
Baris 1:
{{Documentation subpage}}<!--only displayed when viewed from /doc page-->
{{Intricate template}}
<!---PLEASE ADD categories TO THE <includeonly> SECTION AT THE BOTTOM OF THIS PAGE. EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE--->
This template allows for the quick creation of a [[Wikipedia:Navigation templates|navigational template]] for any group of articles which contains the names of the [[U.S. state]]s. It uses {{tlx|Navbox}} to create the navigation box.
== Blank syntax ==
<pre>
{{Amerika Serikat
<!--sama seperti Templat:Navbox-->
|name =
|state =
|title =
|titlestyle =
|bodystyle =
|groupstyle =
<!--khusus untuk Templat:Amerika Serikat-->
|prefix =
|suffix =
Baris 26 ⟶ 25:
== Parameters ==
===Mandatory===
; ''name''
Baris 32 ⟶ 30:
''One of the following combinations is needed to create the links:
; ''prefix''
: Places text before the U.S. state name. For example: <code><span style="white-space:nowrap;">|prefix = List of airports in</span></code> 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.
Baris 38 ⟶ 35:
; ''suffix''
: Places text after the U.S. state name. For example: <code><span style="white-space:nowrap;">|suffix = National Guard</span></code> would create a title [[National Guard of the United States|United States National Guard]] and a body containing state names linked to [[Alabama National Guard]], [[Alaska National Guard]], etc.
; ''prefix'' {{nobold|and}} ''suffix''
: Places text before and after the U.S. state name. For example: <code><span style="white-space:nowrap;">|prefix = List of</span></code> and <code><span style="white-space:nowrap;">|suffix = rivers</span></code> would create a title [[List of rivers of the United States|List of United States rivers]] and a body containing state names linked to [[List of rivers of Alabama|List of Alabama rivers]], [[List of rivers of Alaska|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 <code>autocollapse</code> will start out collapsed if there are two or more tables on the same page that use <
: Default is: <code>autocollapse</code>.
; ''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
:; ''navbar''<nowiki>*</nowiki>
:: Defaults to <code>Tnavbar</code>. If set to <code>plain</code>, the <small>v • d • e</small> links on the left side of the titlebar will not be displayed, and padding will be automatically used to keep the title centered. Use <code>off</code> to remove the <small>v • d • e</small> 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 have their own articles on particular topics. To disable their inclusion in the template and avoid unnecessary [[Wikipedia:Red link|red link]]s, add any or all of the following parameters:
; ''exclude-wdc''
Baris 75 ⟶ 59:
; ''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''
: 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====
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".
:: <code>| DC = District of Columbia</code>
; ''GA''
: Replace "Georgia (U.S. state)" in links with specified text, i.e. "Georgia".
:: <code>| GA = Georgia</code>
; ''NY''
: Replace "New York" in links with specified text, i.e. "New York State".
:: <code>| NY = New York State</code>
; ''WA''
: Replace "Washington (U.S. state)" in links with specified text, i.e. "Washington".
:: <code>| WA = Washington</code>
====Styles====
; ''titlestyle''
: Specifies [[Cascading Style Sheets|CSS]] values to apply to the title. One use of this is to set the background color of the title:
:: <code>titlestyle = background: #0000FF;</code>
:: <code>titlestyle = background: blue;</code>
:Default is: <code><span style="background: #ccccff;">background: #ccccff;</span></code>
; ''bodystyle''
: Specifies CSS values to apply to the entire template. This will not override the following {{tl|Navbox}} default styles:
:: <code>abovestyle = background:#ddddff;</code>
:: <code>belowstyle = background:#ddddff;</code>
:: <code>groupstyle = background:#ddddff; text-align:right; white-space:nowrap;</code>
:: <code>liststyle = width:100%; font-size:95%;</code>
; ''abovestyle''
; ''belowstyle''
: Specifies CSS values to apply to the cell specified via the ''above'' and ''below'' parameters. For instance:
:: <code>belowstyle = border-top: #ccccff 1px solid;</code>
:Default is: <code><span style="background: #ddddff;">background: #ddddff;</span></code>
; ''groupstyle''
: Specifies CSS values to apply to the cells specified via the ''group<sub>n</sub>'' cells. This option overrides any styles that are applied to the entire table. Example:
:: <code>groupstyle = background:#6AFB92; vertical-align:top;</code>
:Default is: <code><span style="background: #ddddff;">background: #ddddff;</span> text-align:right; white-space:nowrap;</code>
; ''liststyle''
: Specifies CSS values to apply to the cells specified via the ''list<sub>n</sub>'' cells. This option overrides any styles that are applied to the entire table. Examples:
:: <code>liststyle = padding: 5px 10px 5px 10px;</code>
:Default is: <code>width:100%; font-size:95%;</code>
== Examples ==
===Changing the
<pre>
{{Amerika Serikat
|title = [[Daftar kota di Amerika Serikat]] menurut negara bagian
|prefix = Daftar kota di
}}
</pre>
{{Amerika Serikat
|state = uncollapsed
|title = [[Daftar kota di Amerika Serikat]] menurut negara bagian
|prefix = Daftar kota di
}}
===
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.
<pre>
{{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
}}
</pre>
{{Amerika Serikat
|state
|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===
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".
<pre>
{{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
Baris 119 ⟶ 181:
</pre>
{{Amerika Serikat
|state
|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
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".
<pre>
{{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
}}
</pre>
{{Amerika Serikat
|state = uncollapsed
|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===
This example also shows use of the '''group5''' and '''list5''' parameters to add a group and list.
<pre style="overflow:auto;">
{{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
</pre>
{{Amerika Serikat
<!--passed through to Template: Navbox -->
| state = uncollapsed
| 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==
Kode yang digunakan untuk membuat [[Templat:RS di AS]]:
<pre>
{{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>
[[
</noinclude>
</pre>
Baris 144 ⟶ 265:
Result:
{{Amerika Serikat
<!--sama seperti Templat:Navbox-->
| state = uncollapsed
| name = Amerika Serikat/doc
|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
}}
== Templat yang menggunakan templat ini ==
# [[
# [[
# [[Templat:Kota di AS]]
# [[Templat:RS di AS]]
# [[Templat:Sungai di AS]]<!--
# [[Templat:All-US-interest]]
# [[
# [[Templat:ClimateUS]]
# [[Templat:FrogsAndToadsByState]]
# [[Templat:Grand Lodges in the United States]]
# [[
# [[
# [[
# [[Templat:Lists of US state agencies]]
# [[Templat:Lists of casinos by U.S. state]]
# [[Templat:Lists of colleges and universities in the United States]]
# [[Templat:Lists of people by U.S. state]]
# [[Templat:Lists of state forests by U.S. state]]
# [[Templat:Lists of state parks by U.S. state]]
# [[Templat:Newspapers in the United States]]
# [[Templat:Political party strength in U.S. states]]
# [[Templat:Politics in the United States]]
# [[Templat:Politics of the United States sidebar templates]]
# [[Templat:Scouting in the United States]]
# [[Templat:Social Policy in the United States]]
# [[Templat:Superfund sites in the United States]]
# [[Templat:U.S. political divisions drug policy]]
# [[Templat:U.S. political divisions education]]
# [[Templat:U.S. political divisions electoral reform]]
# [[Templat:U.S. political divisions geographies]]
# [[Templat:U.S. political divisions governments]]
# [[Templat:U.S. political divisions histories]]
# [[Templat:U.S. state templates]]
# [[Templat:US historical outlines]]
# [[Templat:US outlines]]
# [[Templat:US state seals]]
# [[Templat:USPoliticalDivisions]]
# [[Templat:Vehicle registration plates of the United States]]
; Dahulu menggunakan templat ini
# [[Templat:NGbystate]]
# [[
# [[Templat:US ARNG by state]]-->
== Lihat pula ==
{{Templat menurut benua}}
<includeonly>
[[Kategori:Templat Amerika Serikat| ]]
[[Kategori:Templat menurut negara bagian di Amerika Serikat| ]]
</includeonly>
|