Difference between revisions of "Template:Collapsible sections option/doc"

From blackwiki
Jump to navigation Jump to search
imported>Sardanaphalus
(Generic template demo, hlist, \sandbox)
imported>Sardanaphalus
(some fleshing-out)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 
<!----Categories where indicated at the bottom of this page, please; interwikis to Wikidata---->
 
<!----Categories where indicated at the bottom of this page, please; interwikis to Wikidata---->
{{Generic template demo |list |example |default}}
 
  
===Usage===
+
{{tl|Collapsible sections option}} is a standardised message indicating how the collapsible parts of a template built from {{tl|Navbox with collapsible groups}} may be managed.
 +
 
 +
===Syntax===
 
<pre>
 
<pre>
 
{{Collapsible sections option
 
{{Collapsible sections option
 
| list =  
 
| list =  
| example =  
+
| example = <!--(optional)-->
| default =  
+
| default = <!--(optional)-->
 
}}
 
}}
 
</pre>
 
</pre>
Parameters ''example'' and ''default'' are optional.
 
  
====Example====
+
{{plaincode|list}} is a list of the section/group/etc names (the {{padr|''section[N]name''}}s{{\}}{{padr|''group[N]name''}}s{{\}}{{padr|''abbr[N]''}}s) given in the template's code; {{plaincode|default}} indicates which, if any, is to be shown expanded by default.
 +
 
 +
===Example===
 +
{{Navbox with collapsible sections
 +
|state=expanded |title=Example|navbar=plain |selected={{{selected|{{{expanded|{{{1|overview}}}}}}}}} |abbr1=overview|sect1=Overview|content1=(''content1'') |abbr2=two-word name|sect2=Two-word title|content2=(''content2'') |abbr3=concepts|sect3=[[Concept]]s|content3=(''content3'') |abbr4=related|sect4=Related topics|content4=(''content4'')
 +
}}
 +
 
 +
The code for a <nowiki>{{Collapsible sections option}}</nowiki> for the above template could be:
 
<pre>
 
<pre>
 
{{Collapsible sections option
 
{{Collapsible sections option
| list = {{hlist |overview |"two-word groupname" |concepts |details |related}}
+
| list = {{hlist |overview |"two-word name" |concepts |details |related}}
| example = two-word groupname
+
| example = two-word name
 
| default = overview
 
| default = overview
 
}}
 
}}
 
</pre>
 
</pre>
produces:
+
This code would produce:
 
<div style="clear:both;background:whitesmoke;">
 
<div style="clear:both;background:whitesmoke;">
{{Collapsible sections option{{\sandbox}}}}
+
{{Collapsible sections option{{\sandbox}}
| list = {{hlist |overview |"two-word groupname" |concepts |details |related}}
+
| template_name = Example
| example = two-word groupname
+
| list = {{hlist |overview |"two-word name" |concepts |details |related}}
 +
| example = two-word name
 
| default = overview
 
| default = overview
 
}}
 
}}
Line 38: Line 46:
 
| <!----Categories below this line, please:---->
 
| <!----Categories below this line, please:---->
 
[[Category:Wikipedia metatemplates]]
 
[[Category:Wikipedia metatemplates]]
 +
[[Category:Template namespace templates]]
  
 
[[ar:قالب:Collapsible sections option]]
 
[[ar:قالب:Collapsible sections option]]

Revision as of 18:04, 26 October 2014

{{Collapsible sections option}} is a standardised message indicating how the collapsible parts of a template built from {{Navbox with collapsible groups}} may be managed.

Syntax

{{Collapsible sections option
| list = 
| example =  <!--(optional)-->
| default =  <!--(optional)-->
}}

Template:Plaincode is a list of the section/group/etc names (the Template:Padrs / Template:Padrs / Template:Padrs) given in the template's code; Template:Plaincode indicates which, if any, is to be shown expanded by default.

Example

Template:Navbox with collapsible sections

The code for a {{Collapsible sections option}} for the above template could be:

{{Collapsible sections option
| list = {{hlist |overview |"two-word name" |concepts |details |related}}
| example = two-word name
| default = overview
}}

This code would produce:

{{Collapsible sections optionTemplate:\sandbox | template_name = Example

| list =
  • overview
  • "two-word name"
  • concepts
  • details
  • related

| example = two-word name | default = overview }}

See also