Templat:Topik Amerika Serikat/doc: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
k +terjemah
Taylor 49 (bicara | kontrib)
interwiki to WikiData only
 
(15 revisi perantara oleh 6 pengguna tidak ditampilkan)
Baris 1:
{{Documentation subpage}}<!--only displayed when viewed from /doc page-->
<includeonly>{{template doc page transcluded}}</includeonly><noinclude>{{template doc page viewed directly}}</noinclude>
{{Intricate template}}
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
<!---PLEASE ADD categories TO THE <includeonly> SECTION AT THE BOTTOM OF THIS PAGE. EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE--->
<includeonly>{{Esoteric}}</includeonly>
{{terjemah|Inggris}}
This template allows quick creation of [[Wikipedia:Navigational templates|navigational template]] for groups of articles containing names of [[U.S. states]]. It uses [[:Template:Navbox generic]] to create the navigation box.
 
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>
{{United States topic
<!-- passed through to Template:Navbox generic -->
|name =
|state =
|title_style = background:
|title =
|style =
|group_style =
 
== Blank syntax ==
<!-- specific to Template:United States topic -->
<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 <ttcode>collapsible</ttcode>. If set to <code>collapsed</code>, the navbox will always start out in a collapsed state. If set to blank or anything other than <code>autocollapse</code> or <code>collapsed</code>, the navbox will always start out in an expanded state.
: Default is: <code>autocollapse</code>.
 
; ''title_style'' <span style="font-weight:normal;">= background&#58;</span>
: (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 <span style="background:#ccccff; color:black;">&nbsp;background:#ccccff&nbsp;</span>.
 
; ''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-link]]edwikilinked. For example: <code><span style="white-space:nowrap;"><nowiki>title = [[List of rivers inof the United States|Rivers in the United States]]</nowiki></span></code> generates the title '''[[List of rivers inof the United States|Rivers in the United States]]'''.
 
; ''style''
: Specifies [[Cascading Style Sheets|CSS]] values to apply to the template. For instance:
:: <code>text-align:[right|center|left|justified]; width:(em, %, px, auto); float:[left|right|none]; clear:[right|left|both|none]; margin:</code>...etc.
: This option should be used sparingly as it can lead to visual inconsistencies.
:Default is: <code>text-align:left;</code>
 
:; ''navbar''<nowiki>*</nowiki>
; ''group_style''
:: 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.
: Specifies [[Cascading Style Sheets|CSS]] values to apply to the "group" cells. For instance:
:: <code>background:#nnnnnn; text-align:[left|center|right]; vertical-align:[top|middle|bottom]</code>...etc.
: This option overrides any styles that are applied to the entire table.
:Default is: <code>text-align:center;</code>
 
====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 navigation boxnavbox title===
<pre>
{{Amerika Serikat
|title = [[Daftar kota di Amerika Serikat]] menurut negara bagian
|prefix = History of
|prefix = Daftar kota di
|title = [[History of the United States]] by political division
}}
</pre>
{{Amerika Serikat
|state = uncollapsed
|title = [[Daftar kota di Amerika Serikat]] menurut negara bagian
|prefix = History of
|prefix = Daftar kota di
|title = [[History of the United States]] by political division
}}
 
=== ExcludeExcluding display of federal district, territories orand 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.
<pre>
{{Amerika Serikat
|title = [[Daftar bandar udara di Amerika Serikat|Daftar bandar udara]] di [[Amerika Serikat]]
|prefix = List of airports in
|titlestyle = background: #64E986;
|title = [[Airports in the United States]]
|groupstyle = background: #6AFB92; vertical-align: top;
|exclude-wdc=y
|prefix = Daftar bandar udara di
|exclude-isl=y
|WA = Washington
|exclude-wdc = y
|exclude-isl = y
}}
</pre>
{{Amerika Serikat
|state = uncollapsed
|title = [[Daftar bandar udara di Amerika Serikat|Daftar bandar udara]] di [[Amerika Serikat]]
|prefix = List of airports in
|titlestyle = background: #64E986;
|title = [[Airports in the United States]]
|groupstyle = background: #6AFB92; vertical-align: top;
|exclude-wdc=y
|prefix = Daftar bandar udara di
|exclude-isl=y
|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;
|prefix = List of hospitals in
|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 = uncollapsed
|liststyle = padding: 5px 10px 5px 10px;
|prefix = List of hospitals in
|group1 =
|prefix = List of
|suffix = -related topics
|GA = Georgia
|exclude-wdc = y
|exclude-ter = y
|exclude-isl = y
}}
 
===Adding Creatingsuffix awith new templateleading 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".
Code used to create [[Template:Hospitals in the United States]]:
<pre>
{{Amerika Serikat
|title = [[List of rivers of the United States|Rivers in the United States]]
<!-- passed through to Template: Navbox generic -->
|prefix = List of
| name = {{subst:PAGENAME}}
|suffix = _rivers
| title = [[List of hospitals in the United States|Hospitals in the United States]]
|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.&nbsp;Virgin&nbsp;Islands]]
<!-- specific to Template: United States topic -->
| suffix = _National Guard
| prefix = List of hospitals in
| 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.&nbsp;Virgin&nbsp;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>
[[CategoryKategori:UnitedTemplat Statesmenurut topicnegara navigationalbagian boxesdi Amerika Serikat|{{PAGENAME}}]]
</noinclude>
</pre>
Baris 144 ⟶ 265:
Result:
{{Amerika Serikat
<!--sama seperti Templat:Navbox-->
|name = Hospitals in the United States
| state = uncollapsed
|title = [[List of hospitals in the United States|Hospitals in the United States]]
| name = Amerika Serikat/doc
|state = uncollapsed
|title=[[Daftar rumah sakit di Amerika Serikat|Daftar rumah sakit]] di [[Amerika Serikat]]
|prefix = List of hospitals in
<!--khusus untuk Templat:Amerika Serikat-->
|exclude-ter = y
| prefix = Daftar rumah sakit di
|exclude-isl = y
| WA = Washington
| exclude-ter = y
| exclude-isl = y
}}
 
== Templat yang menggunakan templat ini ==
== Templates implemented with United States topic ==
# [[TemplateTemplat:Bandara All-US-interestdi AS]]
# [[TemplateTemplat:Bendera AmScoutbystatedi AS]]
# [[Templat:Kota di AS]]
# [[Template: History of slavery in the United States]]
# [[Templat:RS di AS]]
# [[Template: Hospitals in the United States]]
# [[Templat:Sungai di AS]]<!--
# [[Template: List of United States airports]]
# [[Templat:All-US-interest]]
# [[Template: Lists of people by U.S. state]]
# [[TemplateTemplat: NGbystateCAP]]
# [[Templat:ClimateUS]]
# [[Template: Politics in the United States]]
# [[Templat:FrogsAndToadsByState]]
# [[Template: Rivers in the United States]]
# [[Templat:Grand Lodges in the United States]]
# [[Template: U.S. political divisions histories]]
# [[TemplateTemplat:History USof ANGslavery byin statethe United States]]
# [[TemplateTemplat:LGBT USrights ARNGin bythe stateUnited States]]
# [[TemplateTemplat:Lakes USin statethe sealsUnited States]]
# [[Templat:Lists of US state agencies]]
# [[Template: USPoliticalDivisions]]
# [[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
<includeonly>
# [[Templat:NGbystate]]
<!--Categories-->
# [[Kategori:Templat:US ANG Amerikaby Serikat|{{PAGENAME}}state]]
# [[Templat:US ARNG by state]]-->
 
== Lihat pula ==
<!--Other languages-->
{{Templat menurut benua}}
 
<includeonly>
[[Kategori:Templat Amerika Serikat| ]]
[[Kategori:Templat menurut negara bagian di Amerika Serikat| ]]
</includeonly>