Templat:Navbox with collapsible groups/doc: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
MerlIwBot (bicara | kontrib)
k Robot: Perubahan kosmetika
Baris 5:
 
== Usage ==
Please remove the parameters that are left blank. The template currently supports up to 10 groups/lists but more can be added if needed. You should use a minimum of two groups/lists; otherwise, use {{t1|Navbox}} instead.
 
<pre>{{Navbox with collapsible groups
Baris 33:
 
== Parameters ==
This template shares many common parameters with its sister templates {{t1|Navbox}} and {{t1|Navbox with columns}}. The common parameters are marked with a cross<sup>'''†'''</sup>. Please refer to the documentation of {{t1|Navbox}} for more in depth descriptions and examples of those parameters.
 
=== Setup parameters ===
:;name<sup>†</sup>
::The name of the template. The name of this template, for example, is "Navbox with collapsible groups".
 
:; ''state''<sup>†</sup> <span style="font-weight:normal;">[<code>autocollapse, uncollapsed, collapsed, plain, off</code>]</span>
::The initial state of the show/hide feature for the main title. See {{t1|Navbox}} for more information. Does not affect display or hiding of group items, see ''state<sub>n</sub>'', below.
 
:;''navbar''<sup>†</sup>
::Possible values are <code>plain</code>, <code>off</code>, and the default value of blank. See {{t1|Navbox}} for more information.
 
:;''border''<sup>†</sup>
::Possible values are <code>child</code>, <code>none</code>, and the default value of blank. Set to <code>child</code> if you wish to use the navbox inside of another navbox; with this option, the child navbox is borderless and fits snuggly inside of its parent navbox. The parent navbox may be the list area of {{t1|Navbox}}, the columns of a {{t1|Navbox with columns}}, or a list area of {{t1|Navbox with collapsible groups}}. See {{t1|Navbox}} for more information and examples.
 
=== Basic data parameters ===
:;'''''title'''''<sup>†</sup>
::The title of the template, displayed centered in the titlebar at the top of the template.
Baris 64:
::Text or other elements to appear below the groups/lists.
 
=== Group/list parameters ===
:; ''group<sub>n</sub>''<sup>†</sup>
:: The title of each section.
 
:; ''list<sub>n</sub>''<sup>†</sup>
:: The content/wikilinks that will be shown in the group. Use dots or bullets as separators (see the [[#See also|See also]] section). A {{t1|Navbox}} or {{t1|Navbox with columns}} can optionally be used here with its <code>border = child</code> parameter set. If this is done, leave the corresponding group<sub>n</sub> blank, as the child navbox will already provide the collapsible feature.
 
:; ''abbr<sub>n</sub>''
:: This is the abbreviation of the group. See <code>selected</code> parameter immediately below to see how to use this parameter. This parameter is optional, but recommended.
 
:; ''selected''
:: If the value of <code>selected</code> equals the value of <code>abbr<sub>n</sub></code>, then list<sub>n</sub> is uncollapsed and all other lists are collapsed. If <code>selected</code> is left blank, or if it does not match any <code>abbr<sub>n</sub></code>, then all groups are collapsed. Usually this parameter should be set to <tt><nowiki>{{{1|}}}</nowiki></tt>. Since this template is a base template for others, there has to be a way to pass the group parameter from the article, to the secondary template to this one.
 
:: The collapsed/uncollapsed options can be listed on the template's page by using the {{tl|Collapsible sections option}} template in the <nowiki><noinclude></nowiki> part of the page.
 
:; ''state<sub>n</sub>'' <span style="font-weight:normal;">[<code>autocollapse, uncollapsed, collapsed, plain, off</code>]</span>
:: The initial collapsible state of list<sub>n</sub>. Set to collapsed by default. Overridden to uncollapsed if <code>selected</code> equals <code>abbr<sub>n</sub></code>.
 
:; ''image<sub>n</sub>''
Baris 88:
:: An image to appear in the list<sub>n</sub> content area on the left side.
 
=== Style parameters ===
:;''bodystyle''<sup>†</sup>
::CSS style/s to apply to the entire template
 
:;''titlestyle''<sup>†</sup>
::[[Wikipedia:CSS|CSS]] style/s to apply to titlebar; usually <code>background:''color''</code>. The color of wikilink text must be manually changed using span tags. For example use <code><nowiki>title = [[Scouting|<span style="color:ivory;">Scouting</span>]]</nowiki></code> to change the color of the link to ivory. The [show]/[hide] button and the vde link button use the color set in the titlestyle parameter. Here is an example of setting the titlestyle:
:::<code>titlestyle = background:darkgreen;color:ivory;</code>
 
Baris 104:
 
:;''imagestyle''<sup>†</sup>
::CSS style/s to apply to the ''image'' parameter. Does not get applied to the image<sub>n</sub> parameters.
 
:;''imageleftstyle''<sup>†</sup>
::CSS style/s to apply to the ''imageleft'' parameter. Does not get applied to the imageleft<sub>n</sub> parameters.
 
:; ''groupstyle''<sup>†</sup>
:: CSS style/s to apply to all group heading parameters. Visit [http://meyerweb.com/eric/tools/color-blend/ this website] to get a lighter color similar to the title background color. Example:
:::<code>groupstyle = background:lightgreen;</code>
 
Baris 125:
:: Padding to have in each list cell; defaults to 0.25em on the left/right and 0em on the top/bottom.
 
=== Microformat parameters ===
:; ''bodyclass''<sup>†</sup>
:: This parameter is inserted into the "class" attribute for the infobox as a whole.
Baris 135:
 
== Examples ==
=== Basic example ===
<pre style="overflow:scroll;">
{{Navbox with collapsible groups
Baris 183:
}}
 
=== Nesting other Navbox forms ===
This example shows {{t1|Navbox}}, {{t1|Navbox with collapsible groups}} and {{t1|Navbox with columns}} all working together. Press the edit button for the section to view the code. Note that each of the child navboxes has the first parameter set to <code>child</code>
{{Navbox with collapsible groups
|name = Navbox with collapsible groups
Baris 270:
}}
 
=== Nesting Navboxes to get more groups/lists ===
You can conveniently nest Navboxes, including {{t1|Navbox with collapsible groups}}, to get an unlimited number of groups/lists. The following example uses one instance of {{t1|Navbox with collapsible groups}} to get the first 10 collapsible groups, a nested instance to get the next 10, and another nested instance to get the last 6. See the code to learn how it works. It is fairly simple to extend this to as many groups/lists as you like:
 
{{Navbox with collapsible groups