Templat:Topik Amerika Serikat/doc: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
kTidak ada ringkasan suntingan
k bot kosmetik perubahan
Baris 5:
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.
 
== Blank syntax ==
<pre>
{{United States topic
Baris 27:
== Parameters ==
 
=== Mandatory ===
; ''name''
: Mandatory when creating a new template (i.e. [[TemplateTemplat:Hospitals in the United States]]), otherwise the the "view{{·}} talk{{·}} edit" links will connect to [[TemplateTemplat:United States topic]]. You can enter <code><nowiki>{{subst:PAGENAME}}</nowiki></code> 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: <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.
: 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: <code><span style="white-space:nowrap;">|suffix = National Guard</span></code> 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: <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 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 <code>autocollapse</code> will start out collapsed if there are two or more tables on the same page that use <tt>collapsible</tt>. 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]]ed. For example: <code><span style="white-space:nowrap;"><nowiki>title = [[List of rivers in the United States|Rivers in the United States]]</nowiki></span></code> generates the title '''[[List of rivers in the United States|Rivers in the United States]]'''.
 
; ''style''
Baris 68:
:Default is: <code>text-align:center;</code>
 
==== 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 [[Wikipedia:Red link|red link]]s, add any or all of the following parameters:
 
Baris 81:
 
== Examples ==
=== Changing the navigation box title ===
<pre>
{{Amerika Serikat
Baris 128:
 
=== Creating a new template ===
Code used to create [[TemplateTemplat:Hospitals in the United States]]:
<pre>
{{Amerika Serikat
Baris 142:
</noinclude>
</pre>
Note: '''<nowiki>{{subst:PAGENAME}}</nowiki>''' in the above example would be replaced by '''Hospitals in the United States''' when this code is saved in [[TemplateTemplat:Hospitals in the United States]].
 
Result: