Template:Expand

From LOS Warmachine University
Jump to: navigation, search
{{{intro}}}   [Show/Hide]
{{{content}}}

This template need 3 inputs

  • ID (optional, will default to 1)
  • Intro (optional, will default to blank)
  • Content

Note that if this template is used multiple times on an article, and each ID isn't unique, the wrong content will be shown/hidden when the button is clicked.

{{Expand
|ID=aaa
|Intro=Show A
|Content=Test A
}}

{{Expand
|ID=bbb
|Intro =Show B
|Content=Test B
}}
Show A   [Show/Hide]
Test A
Show B   [Show/Hide]
Test B

This template is a bit buggy when it comes to nested lists. It seems everything inside the hidden portion needs to be at a lower nest level.

* {{Expand
|ID=ccc
|Intro=Same level list - buggy
|Content=
* 1 This text should be hidden.
}}

* {{Expand
|ID=ccc
|Intro=Different level list - not buggy
|Content=
** 2 This text should be hidden.
}}
  • Same level list - buggy   [Show/Hide]
  • 1 This text should be hidden.