FANDOM


Nuvola apps kservices This article is about a system or feature that is no longer in use.
  • The page is retained for historical reasons.

CollapsibleInfobox is a script for easily collapsing sections of {{infobox (collapsible)}}.

Prerequisites

Template

Template:Infobox (collapsible) should be copied to your wiki. New wikis come with a variation of this template already, but this one has altered code to work with the script. If you're already using the default version of the infobox, you should be able to copy this template code to "Template:Infobox", without breaking the infoboxes you already use.

JavaScript

This line should go in your wiki's MediaWiki:Common.js:

importScriptPage('CollapsibleInfobox/code.js', 'dev'); 

CSS

This must go in your MediaWiki:Common.css:

a.infoboxtoggle { float: right; } /* positions the +/- */
.hidden { display: none; } /* hides hidden rows */
tr.header.hidden { display: table-row; } /* does _not_ hide headers */

Usage

  • The box can have up to 60 of the numbered rows.
  • When you give a header a class, a +/- button is added that when clicked will show/hide all the other rows (or "below" section) with the same class.
  • If you add "hidden" to the class of a header, the rows with that class (excluding the header) will be collapsed by default.
{{Infobox (collapsible)
|title   = overtitle
|above   = {{{name|{{PAGENAME}}}}}
|image   = [[File:Example.jpg]]
|caption = Example image

|label1 = label 1
|data1  = data 1

|label2 = label 2
|data2  = data 2

|header3 = header 3
|class3  = class3

|label4 = label 4
|data4  = data 4
|class4 = class3

|label5 = label 5
|data5  = data 5
|class5 = class3

|label6 = label 6
|data6  = data 6
|class6 = class3

|header7 = header 7
|class7  = class7 hidden

|label8 = label 8
|data8  = data 8
|class8 = class7

|label9 = label 9
|data9  = data 9
|class9 = class7

|header10 = header 10

|label11 = label 11
|data11  = data 11

|label12 = label 12
|data12  = data 12

|header13  = header 13
|class13   = class13

|label14 = label 14
|data14  = data 14
|class14 = class13

|label15 = label 15
|data15  = data 15

|label16 = label 16
|data16  = data 16
|class16 = class13

|header60 = header 60
|class60  = class60

|below       = below content
|class_below = class60
}}
overtitle
CollapsibleInfobox
Example
Example image
label 1data 1
label 2data 2
header 3
label 4data 4
label 5data 5
label 6data 6
label 8data 8
label 9data 9
header 10
label 11data 11
label 12data 12
header 13
label 14data 14
label 15data 15
label 16data 16
header 60
below content

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.