Template:Databox: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
m +category
ArrowHead294 (talk | contribs)
mNo edit summary
 
(17 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<includeonly><div class="toccolours mw-collapsible mw-collapsed" style="width:600px; overflow:auto;">'''{{{1|{{{title}}} }}}'''<div class="mw-collapsible-content">{{{2|{{{text}}} }}}</div></div></includeonly><noinclude>
<includeonly><div class="toccolours {{#ifeq: {{{collapse|}}}|false||mw-collapsible {{#ifeq: {{{defaultstate|}}}|expanded||mw-collapsed}}}}" style="overflow: auto;">'''{{{1|{{{title|}}}}}}'''{{#if: {{{2|{{{text|}}}}}}|<div class="mw-collapsible-content">{{{2|{{{text}}}}}}</div>|}}</div></includeonly><noinclude>
This template creates a collapsible text box.
{{documentation}}
 
You type:
 
<pre>
{{Databox|Title|
Contents
}}
</pre>
 
You get:
 
{{{{PAGENAME}}|Title|
Contents
}}
 
Note: To include the character <code>|</code>, it must be escaped as <code><nowiki>{{!}}</nowiki></code>.


[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Latest revision as of 18:17, 30 January 2025

Template documentation[view] [edit] [history] [purge]

This template creates a collapsible text box. If you want the box to be expanded by default, set the parameter defaultstate=expanded.

Usage

You type:

{{Databox
| Title
| Contents
}}

You get:

Title
Contents

To make a databox permanently expanded, pass collapse=false as follows:

{{Databox|collapse=false
| Title
| Contents
}}
Title
Contents

Note: Pipe characters (|) must be escaped as {{!}} or {{pipe}}, equals signs must be escaped as {{=}} (this may apply to tags as well, e.g. <div style{{=}}"…">), and other special characters and character sequences may need to be escaped accordingly, except for ones inside <nowiki>, <pre>, <math>, and <syntaxhighlight> tags.