m (changed {{{summary}}} so it is not just availble if {{{section}}} is used) |
Kentsmith9 (talk | contribs) (Added category to page) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 10: | Line 10: | ||
{{Para|either a nugget/subpage link, or raw content}} {{red|*required}} if left blank will produce an error. | {{Para||either a nugget/subpage link, or raw content}} {{red|*required}} if left blank will produce an error. | ||
{{Para|description text to be used in header line}} if left blank it will use the {{Tl|SUBPAGENAME|nl}} of the first parameter. | {{Para||description text to be used in header line}} if left blank it will use the {{Tl|SUBPAGENAME|nl}} of the first parameter. | ||
{{para|summary|short descriptive summary}} This optional parameter<!-- is only available if the {{Para|section|#}} parameter is also used. It--> allows you to define a very short summary text to be displayed in the header of the collapsible section. This will override the description parameter. If this is not used the default header will be used: | {{para|summary|short descriptive summary}} This optional parameter<!-- is only available if the {{Para|section|#}} parameter is also used. It--> allows you to define a very short summary text to be displayed in the header of the collapsible section. This will override the description parameter. If this is not used the default header will be used: | ||
<code>Click expand for details on ...<description, or {{Tl|SUBPAGENAME|nl}}></code> | <code>Click expand for details on ...<description, or {{Tl|SUBPAGENAME|nl}}></code> | ||
{{Para|nt|yes}} content is | {{Para|nt|yes}} not transcluded; content is wiki text to be rendered directly (do not enclose in curly braces for transclusion). | ||
{{Para|section|#}} any number 1-4, if anything else is entered it defaults to 5. This replaces the header test with just the description from the 2nd parameter (or the {{tl|SUBPAGENAME|nl}} of the 1st parameter, and formats it as a section header. The number entered is the header level used. | {{Para|section|#}} any number 1-4, if anything else is entered it defaults to 5. This replaces the header test with just the description from the 2nd parameter (or the {{tl|SUBPAGENAME|nl}} of the 1st parameter, and formats it as a section header. The number entered is the header level used. | ||
Line 84: | Line 84: | ||
<includeonly> | <includeonly> | ||
<!-- ADD CATEGORIES BELOW THIS LINE --> | <!-- ADD CATEGORIES BELOW THIS LINE --> | ||
[[Category:Page formatting templates]] | |||
<!-- ADD INTERWIKIS BELOW THIS LINE --> | <!-- ADD INTERWIKIS BELOW THIS LINE --> | ||
</includeonly> | </includeonly> | ||
<templatedata> | |||
{ | |||
"params": { | |||
"1": { | |||
"label": "Content or Link to transclude", | |||
"description": "This is where you put the content of the section, or the link to the page nugget you want to transclude here", | |||
"type": "content", | |||
"required": true | |||
}, | |||
"2": { | |||
"label": "Header text", | |||
"description": "The text to be displayed at the top of the section. If you set the section parameter this will be used as the name for the section header. If not set the default text will use the SUBPAGENAME of the transcluded link ", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"expand": { | |||
"description": "If defined, the section will be expanded by default when the page is loaded.", | |||
"type": "boolean", | |||
"default": "yes" | |||
}, | |||
"style": { | |||
"description": " If defined, the style codes specified here will be used on the collapsible section (such as border, background, etc).", | |||
"type": "string" | |||
}, | |||
"section": { | |||
"label": "Section Header Level", | |||
"description": "A number from 1 to 4 to be determine the header level for the section. If any other text is entered the default will be 5", | |||
"type": "number", | |||
"suggested": true | |||
}, | |||
"nt": { | |||
"label": "no transclude", | |||
"description": "If you put text content instead of a link to transclude in the first parameter, this must be set to \"yes\"", | |||
"type": "boolean", | |||
"default": "yes", | |||
"suggested": true | |||
}, | |||
"editlink": { | |||
"description": "If this parameter is defined the link to edit the transcluded nugget is not displayed.", | |||
"type": "boolean", | |||
"default": "no" | |||
}, | |||
"summary": { | |||
"description": "a very short summary text to be displayed in the header of the collapsible section. This will override the description parameter. If this is not used the default header will be used: Click expand for details on ...<description, or {{SUBPAGENAME}}>", | |||
"type": "content", | |||
"suggested": true | |||
}, | |||
"newscript": { | |||
"description": "Designed to detect input from the {{NewScript}} template, and is not meant to be used manually. If the defined subpage exists already it produces a direct link to the nugget above the transclusion. For script authors convenience", | |||
"type": "boolean" | |||
} | |||
}, | |||
"description": "This template is used to create a collapsible section of content on a page which can be hidden until the user chooses to open it making the pages easier to read, and less daunting at first glance.", | |||
"paramOrder": [ | |||
"1", | |||
"2", | |||
"nt", | |||
"section", | |||
"summary", | |||
"expand", | |||
"editlink", | |||
"newscript", | |||
"style" | |||
] | |||
} | |||
</templatedata> |
Latest revision as of 01:13, 17 August 2022
This is a documentation subpage for . It contains usage information, categories and other content that is not part of the original template page. |
{{Expand|content or link to transclude|description for header|nt=yes|section=#1-4|editlink=no|summary=A short text summary|expand=yes|style=CSS style codes}}
This template takes two unnamed parameters in order, and some additional named parameters to alter the output.
It creates a collapsible section on a page, with a heading and optional summary text text. The heading may be formatted as a section header (level 1-5) which will appear in the TOC.
At the top of the collapsed section, if the content is being transcluded from another source, a link to edit the source directly is displayed by default.
|either a nugget/subpage link, or raw content
*required if left blank will produce an error.
|description text to be used in header line
if left blank it will use the {{SUBPAGENAME}} of the first parameter.
|summary=short descriptive summary
This optional parameter allows you to define a very short summary text to be displayed in the header of the collapsible section. This will override the description parameter. If this is not used the default header will be used:
Click expand for details on ...<description, or {{SUBPAGENAME}}>
|nt=yes
not transcluded; content is wiki text to be rendered directly (do not enclose in curly braces for transclusion).
|section=#
any number 1-4, if anything else is entered it defaults to 5. This replaces the header test with just the description from the 2nd parameter (or the {{SUBPAGENAME}} of the 1st parameter, and formats it as a section header. The number entered is the header level used.
|newscript=yes
Designed to detect input from the {{NewScript}} template, and is not meant to be used manually. If the defined subpage exists already it produces a direct link to the nugget above the transclusion. For script authors convenience
|editlink=no
If this parameter is defined the link to edit the nugget is not displayed.
|expand=yes
If defined, the section will be expanded by default when the page is loaded.
|style=
If defined, the style codes specified here will be used on the collapsible section (such as border, background, etc).
Sample
{{Expand|(LINK)}}
{{Expand|/(LINK)}}
{{Expand|/(LINK)|(HEADER)}}
{{Expand|(CONTENT)|(HEADER)|nt=yes}}
{{ Expand}}
{{Expand|/(LINK)|section=2}}
{{Expand|/(LINK)|(HEADER)|section=2}}
{{Expand|/(LINK)|(HEADER)|section=2|newscript=yes|summary=This is a subsection dedicated to HEADER}}
{{Expand|/(LINK)|(HEADER)|section=2|newscript=yes|edit=/(LINK)|summary=This is a subsection dedicated to HEADER|expand=yes}}
{{Expand|(LINK)|style=border: solid 1px;}}
PRODUCES
See Also
This template relies on:
This template is used by:
- {{NewScript}}
This template is used to create a collapsible section of content on a page which can be hidden until the user chooses to open it making the pages easier to read, and less daunting at first glance.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Content or Link to transclude | 1 | This is where you put the content of the section, or the link to the page nugget you want to transclude here | Content | required |
Header text | 2 | The text to be displayed at the top of the section. If you set the section parameter this will be used as the name for the section header. If not set the default text will use the SUBPAGENAME of the transcluded link | String | suggested |
no transclude | nt | If you put text content instead of a link to transclude in the first parameter, this must be set to "yes"
| Boolean | suggested |
Section Header Level | section | A number from 1 to 4 to be determine the header level for the section. If any other text is entered the default will be 5 | Number | suggested |
summary | summary | a very short summary text to be displayed in the header of the collapsible section. This will override the description parameter. If this is not used the default header will be used: Click expand for details on ...<description, or {{SUBPAGENAME}}> | Content | suggested |
expand | expand | If defined, the section will be expanded by default when the page is loaded.
| Boolean | optional |
editlink | editlink | If this parameter is defined the link to edit the transcluded nugget is not displayed.
| Boolean | optional |
newscript | newscript | Designed to detect input from the {{NewScript}} template, and is not meant to be used manually. If the defined subpage exists already it produces a direct link to the nugget above the transclusion. For script authors convenience | Boolean | optional |
style | style | If defined, the style codes specified here will be used on the collapsible section (such as border, background, etc). | String | optional |