Difference between revisions of "Template:Collapsible sections option"

From blackwiki
Jump to navigation Jump to search
imported>Squiver
(140%/120%)
imported>Edokter
m (Reverted edits by Squiver (talk) to last version by Jdaloner)
Line 1: Line 1:
<div style="font-size:120%;font-weight:bold;margin-bottom:0.25em;"> How to manage this template's <!--
+
<div style="font-size:120%;font-weight:bold;margin-bottom:0.25em;"><!--
  -->{{#if:{{{1|}}}
+
  -->{{#if:{{{1|}}} |<!--(Single collapsible group/section named "{{{1}}}":)-->Collapsible group/section</div> If, by default, this template's collapsible group/section is hidden ("collapsed") when the template [[Wikipedia:Transclusion|is shown]], use {{tlc|<includeonly>{{</includeonly>PAGENAME<includeonly>}}</includeonly>&nbsp;|{{{1}}}}} to set it to be visible ("expanded", "uncollapsed").
 
+
     | How to manage this template's collapsible groups/sections option </div>
    <!---------- Single group/section ---------->
 
    | collapsible group/section </div> If, by default, this template's collapsible group/section is hidden ("collapsed") when the template [[Wikipedia:Transclusion|is shown]], use {{tc|<includeonly>{{</includeonly>PAGENAME<includeonly>}}</includeonly>&nbsp;|{{{1}}}}} to set it to be visible ("expanded", "uncollapsed").
 
 
 
    <!-------- Multiple groups/sections -------->
 
     | collapsible groups/sections </div>
 
 
       {{Unbulleted list
 
       {{Unbulleted list
         | 1 = This template includes collapsible groups/sections. When it [[Wikipedia:Transclusion|first appears]], one of these groups/sections may be set to be visible ("expanded", "uncollapsed") while the others, apart from their titlebars, remain hidden ("collapsed"). To achieve this, [[Help:Template#Parameters|include the parameter]] {{plaincode|&#124;''name''}} where ''name'' is one of the following names identifying the groups/sections (omit any speech or quote marks):
+
         | 1 = This template includes collapsible groups/sections. When it [[Wikipedia:Transclusion|first appears]], one of these groups/sections may be set to be visible ("expanded") while the others remain hidden ("collapsed") apart from their titlebars. To achieve this, [[Help:Template#Parameters|include the parameter]] {{plaincode|&#124;''name''}} where ''name'' is one of the following names identifying the groups/sections (omit any speech or quote marks):
         |item2_style=font-family:monospace;font-size:140%;font-weight:bold; padding:<!--top:-->0.3em <!--right/left:-->1.4em <!--bottom:-->{{#if:{{{example|}}}{{{default|}}} |0.3em |0.75em}};
+
         |item2_style=font-size:120%;font-weight:bold;padding:0.3em 1.4em <!--The following meant to ensure that {{{list}}} is associated with this template rather than anything after it:-->{{#if:{{{example|}}}{{{default|}}} |0.3em |0.75em}};
         | 2 = {{{list}}}
+
         | 2 = {{plaincode|{{{list}}}}}
         <!------Optional example------->
+
         <!------- Example (optional) ------->
         | 3 = {{#if:{{{example|}}}
+
        |item3_style=padding-left:2.8em;
              | For example: <span style="font-family:monospace;font-size:120%;"><!--
+
         | 3 = {{#if:{{{example|}}} |For example: {{tlc|{{{template|<includeonly>{{</includeonly>PAGENAME<includeonly>}}</includeonly>}}}&nbsp;|{{{example}}}<noinclude>&nbsp;</noinclude>}} }}
      open braces: --><nowiki>{{</nowiki><!--
+
       }}
template/PAGENAME: -->{{{template|<includeonly>{{</includeonly>PAGENAME<includeonly>}}</includeonly>}}}&nbsp;<!--
+
       <!-------- Default (optional) ------->
        parameter: -->&#124;{{{example}}}<noinclude>&nbsp;</noinclude><!--
 
      close braces: --><nowiki>}}</nowiki><!--
 
                          --></span>
 
       }}    }}
 
       <!-------Optional default------->
 
 
       {{#if:{{{default|}}} |
 
       {{#if:{{{default|}}} |
* The group/section named <span style="font-family:monospace;font-size:130%;font-weight:bold;">{{{default}}}</span> has been set to be visible when the template appears.
+
* The group/section named '''{{plaincode|{{{default}}}}}''' has been set to be visible when the template appears.
 
     }} }}<noinclude>
 
     }} }}<noinclude>
 
{{Documentation}}
 
{{Documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 15:07, 10 February 2015

How to manage this template's collapsible groups/sections option
  • This template includes collapsible groups/sections. When it first appears, one of these groups/sections may be set to be visible ("expanded") while the others remain hidden ("collapsed") apart from their titlebars. To achieve this, include the parameter Template:Plaincode where name is one of the following names identifying the groups/sections (omit any speech or quote marks):
  • Template:Plaincode
Template documentation[view] [edit] [history] [purge]

{{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)-->
}}

list is a list of the section/group/etc names (the section[N]name  / group[N]name  / abbr[N] parameters) given in the template's code; default indicates which, if any, is to be shown expanded by default.

If the template has only one collapsible group/section,

{{Collapsible section option |name}}

where name is that group/section's name, is recommended instead. It produces a more concise version of the standard message.

Example

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

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

This code would produce:

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

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

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

See also