Template:Collapsible option/doc
{{Documentation subpage}}
{{High-use|demo={{ROOTPAGENAME}}}}
{{tlx|Collapsible option}} is a utility template that provides a standardised message for transclusion on template documentaion pages for templates whose collapsibility may be managed by the parameter {{para|state}}.
It can be used on either the template page itself (wrapped within {{tag|noinclude}} tags), but it is almost always better to place it in the template's {{tlx|documentation subpage}}.
=Indicating optional use of {{samp|state}} name=
{{Update|inaccurate=yes|date=December 2024|reason=Removed in 2015|talk=Broken_statename_parameter}}
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):
{{Collapsible option |statename=optional}}
This possibility is enabled by including:
as part of a collapsible template's {{para|state}} parameter{{spaced ndash}}for instance, as {{para|state|{{{1|}}} {{{state|{{{1|}}}}}} }} or {{para|state|{{{state|{{{1| }}, etc.expanded }}}}}}
,
as part of a collapsible template'sstate
argument{{spaced ndash}}for instance, as {{para|state|{{{state }}|collapsed }}}
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 tables of information, or to cram extraneous details into 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 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}} includes a forward-slash (virgule) character – / – 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 {{tlc|PAGENAME}} rather than the default {{tlc|BASEPAGENAME}} is used to display it).
See also
- {{tl|Navbox documentation}}, which includes this template
- {{tl|Collapsible lists option}}
- {{tl|Collapsible sections option}}
- Collapsing tables and more
Category:Documentation shared content templates
Category:Wikipedia metatemplates
}}