Template

Collapsed text

From Dogcraft Wiki


Template documentation

This template can wrap a paragraph or multiple paragraphs of text in a custom collapsible box, using mediawiki's built-in collapsible tools. This collapsible box is open by default. This custom box will have an iconed close button in the top right corner while open, and will have a centered iconed open button replace the entire content when closed.

Syntax

Example

{{Collapsed text |name=example |content=Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}} generates:

Hide
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

With custom hide/show buttons: {{Collapsed text |name=example2 |hide=Vanish |show=Appear text |content=Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}} generates:

Vanish
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

TemplateData

This template can wrap a paragraph or multiple paragraphs of text in a custom collapsible box, using mediawiki's built-in collapsible tools. This collapsible box is open by default. This custom box will have an iconed close button in the top right corner while open, and will have a centered iconed open button replace the entire content when closed.

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Namename 1

This is as the collapsible section's name. Its not visible, but it should be unique per page. This '''must''' be a single word, use camelCase, '_' or '-' instead of spaces if necessary. If there are two collapsible sections with the same name on the same page, the buttons will toggle both of them. (Because the name is how they tell the difference)

Example
buildings_list
Stringrequired
Contentcontent 2

This parameter contains whatever should be collapsed. It can be multiple paragraphs, divs, etc.

Example
Lorem ipsum dolor sit...
Stringrequired
Hidehide

This parameter sets the text for the button which hides the content, defaults to 'Hide'

Default
Hide
Example
Vanish
Stringsuggested
Showshow

This parameter sets the text for the button which shows the content again after it has been hidden, defaults to 'Show' and is initially hidden (until the content gets hidden)

Default
Show
Example
Appear
Stringsuggested