Changes

Jump to: navigation, search

Template:Collapsible option/doc

3,630 bytes added, 02:15, 22 April 2019
markup cleanup; MOS:DONTHIDE note.
{{Documentation subpage}}
<!-- Categories go where indicated at the bottom of this page, please; interwikis go to Wikidata (see also: [[Wikipedia:Wikidata]]). -->
{{High-risk| approximately 108000 }}
{{tlx|Collapsible option}} provides a standardised message for [[Wikipedia:Transclusion|transclusion]] on the pages of collapsible templates whose collapsibility may be managed by the parameter {{para|state}}.

It may be used on either the template page itself (wrapped within {{tag|noinclude}} tags) or on the template's {{tlx|documentation subpage}}.

===Indicating optional use of {{samp|state}} name===
The {{para|state}} parameter used to manage collapsible templates need not always be named explicitly, i.e. {{tnull|{{var|Template name}}{{!}}{{var|state}}}} can be the same as {{tnull|{{var|Template name}}|state{{=}}{{var|state}}}}, if the template is coded that way. To indicate this in the {{tnull|Collapsible option}} message, add the parameter {{para|statename|optional}}. This modifies the message so that it reads (if it were used for itself):

<div style="clear:both;margin:1.0em 0;background:whitesmoke;">
{{Collapsible option |statename=optional}}
</div>

This possibility is enabled by including:
*<code><nowiki>{{{1|}}}</nowiki></code> as part of a collapsible template's {{para|state}} parameter{{spaced ndash}}for instance, as {{para|state|<nowiki>{{{state|{{{1|}}}}}}</nowiki>}} or {{para|state|<nowiki>{{{state|{{{1|<noinclude>expanded</noinclude>}}}}}}</nowiki>}}, etc.
*<code><nowiki><noinclude></nowiki></code>,<code><nowiki><includeonly></nowiki></code>as part of a collapsible template's <code>state</code> argument{{spaced ndash}}for instance, as {{para|state|<nowiki>{{{state<includeonly>|collapsed</includeonly>}}}</nowiki>}}
If, however, the template includes collapsible sections within itself (e.g. {{tlx|Navbox with collapsible groups}}), then enabling this possibility may introduce ambiguity as regards what is to be collapsed or expanded. In those instances, therefore, the requirement to use {{para|state}} should be retained.

===Changing the default state===
To change the default state {{tnull|Collapsible option}} uses, add the parameter {{para|default|collapsed}} or {{para|default|expanded}} accordingly. To restore the default, remove any {{para|default}} previously included.

The {{para|default|collapsed}} option must not be used in main article content in mainspace, e.g. to hide [[Wikipedia:Manual of Style/Tables|tables of information]], or to cram extraneous details into [[Wikipedia:Manual of Style/Infoboxes|infoboxes]]. {{crossref|printworthy=y|(For more information, see {{section link|Wikipedia:Manual of Style#Scrolling lists and collapsible content}}.)}} This option {{em|is}} permissible in [[Wikipedia:Navigation boxes|navboxes]], which are not part of the article content {{lang|la|per se}}.

===Slashes and the {{samp|nobase}} parameter ===
If the template name given to {{tnull|Collapsible option}}</nowiki> includes a forward-slash (virgule) character – <kbd>/</kbd> – then the parameter {{para|nobase}} (set to {{kbd|on}}, {{kbd|true}}, etc.) will need to be added so that the name is displayed correctly (i.e., so that {{tld|PAGENAME}} rather than the default {{tld|BASEPAGENAME}} is used to display it).

== See also ==
* {{tlx|Collapsible lists option}}
* {{tlx|Collapsible sections option}}
* [[Help:Collapsing]]

<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<!-- Categories go below this line, please; interwikis go to Wikidata, thank you! -->
[[Category:Documentation shared content templates]]
[[Category:Wikipedia metatemplates]]

}}</includeonly>
Anonymous user

Navigation menu