Forum:Collapsible sections?

I intend to make a page that will have a large amount of sections (documentation for MMO addon API), so I'd like to make a list where every section is collapsed by default, and can be expanded by users.

Any tips on how to code this? Or maybe you've seen a wiki that does it so I can check it out?


 * try this code for a template: (from wikipedia originally) which creates a 1 cell collapsible table with header bar (like a navbox) - code Here and Template:collapse bottom that goes after the content (just closed the one cell table). Note: it used the Navbox collapsible routine that is added in to sites Mediawiki:common.JS and CSS pages. I've used it with a photo gallery and some text sections to reduce page size. The header text and background colour is customisable. (Note my doc page has a problem displaying correctly but code works in articles ok) - BulldozerD11 14:11, July 30, 2010 (UTC)

Have done this with most of my tables, and as Bulldozer said, you can choose text and color. example page #1 example page #2 Code is on the page. Have either converted or am converting just about every table that's long on the wiki, so if you check out other pages, you'll find it "in action" there too.

HTH!

We hope 14:29, July 30, 2010 (UTC)

You could do it with collapsible tables...
 * -- Fandyllic  (talk &middot; contr) 9:00 AM PST 30 Jul 2010


 * Thanks, that should do the trick :) I'll post a link when I finish it, for completeness sake. - IcecreamKitten

I think I'll have to abandon this idea... I didn't really think about the size of such a page, which turns out to be over 1400 sections. That should translate into several megabytes worth of data, making it rather impractical /facepalm

I guess I'll just make 1400 separate pages instead (which translates into about 116 hours of work by a rough estimate...) - IcecreamKitten


 * Your original page, striped of the data would still be useful as a table of content. 16:01, July 31, 2010 (UTC)


 * I'd suggest placeing the data on several separate pages to break it into more manageable sections & for ease of control / maintenance, which you then 'transclude' into the article's (main) page - that visitors view, but editors work on the sub-pages (sections). The sub pages can have section headings which then fit in with the main articles headings / toc and form one TOC. Just place were you want the page to appear in the main page, which can be with the collapsible blocks using Fandyllic's  table code or my version packaged in a template (which can be on the sub page). If you have 1400 items on one page the page is Too big anyway to work on effectively as one article and edit clashes could be a major problem, were as updating sub pages is only working on a small element of the page at once so any problems are easier to fix. If sub pages get too big they could be split again. Rhe individual sub pages could be used in several pages, if structured suitably to save duplication/ repetition of content. A lot of wikies Front (main) pages are built that way from several sub pages. The other example is template documentation on wikipedia were the doc page is a separate page that 'appears' on the templates page and in some cases is made up of several other pages - BulldozerD11 19:31, July 31, 2010 (UTC)