Forum:Collapse Tables

Collapsible Tables on my Wiki
Hi, guys. I used Collapsible Tables on my Wiki quite a few years ago, but now I can't remember what the code is. I added a couple of things to the Common.js and Common.css, but my table isn't showing yet as collapsible.

Here is the URL where I am trying to implement the table. Feel free to make necessary changes to the .css and .js pages (1999 Busch North Series Central). Thanks! --DaNASCAT 00:08, 18 February 2009 (UTC)


 * I don't understand your problem.. I see you have the collapsible table code in the wiki's MediaWiki:Common.js. (copied from Wikipedia's?) If you want to make a table collapsible, add the class 'collapsible':

{| class="collapsible" ... Example: -- ko  (talk)  04:17, 18 February 2009 (UTC)


 * That code still does not work. I copied your table onto the site, and it still will not show the table as collapsible. Perhaps it is because I am missing the buttons I thought I added (the code to allow the table to have the show/hide switch), but I think those are in the right place at Common.css.


 * On a related note, does anyone know how Wikipedia programs their pages during their fund drivers to allow a collapsible table at the front of every table. Although I'm not doing a fund drive, I'd like to do a similar design for an extremely exciting site project being unveiled next week. --DaNASCAT 05:02, 18 February 2009 (UTC)


 * The funds rising message at wikipedia is normally in MediaWiki:Sitenotice and/or Mediawiki:anonnotice for anonymous users. But that message can be dismissed by users so to make sure they see it, each time you change it, increment MediaWiki:Sitenotice id.


 * The table on your wiki page is already collapsible : Screen capture. You have to make the browser do an hard refresh of the page if you want the last version of CSS and JS files to be on your computer. Use Shift+F5 or Ctrl+F5 (it depend on the browser). — TulipVorlax 08:29, 18 February 2009 (UTC)


 * Hey, Tulip. Thanks for the tech help! You're always great with the tech end of things. However, a hard refresh still did not update the collapsible for me. Which might raise the question now if this is a browser issue. I can get the collapse hide/show button in IE, but I can not get it in Firefox 3 or Google Chrome. --DaNASCAT 15:27, 18 February 2009 (UTC)


 * I think the some other parts of the JS are interfering with it. It works when the collapsible tables are alone in the js file -- Sixorish 17:52, 18 February 2009 (UTC)


 * There's some JS errors on the MediaWiki:Common.js file. Open the error console to see what happens (in Firefox: it's in the tools menu, or pressing CTRL+SHIFT+J). There's a JS error that stops its execution. --Ciencia Al Poder (talk) -WikiDex 19:30, 18 February 2009 (UTC)
 * Yeah, didn't see that since i dont systematically tests things in Firefox (it's all the contrary when working on my own websites (wich doesn't include wikis)). — TulipVorlax 19:42, 18 February 2009 (UTC)


 * The Firefox error seems to be this line of code

--DaNASCAT 20:23, 18 February 2009 (UTC)


 * If you don't need the other pieces of JS code then consider removing them. -- ko isuru ( talk ) 17:16, 20 February 2009 (UTC)
 * First a note about the Fund Raiser from wikipedia, thats coded by the devs server side there is no mediawiki page where it can be found for modification or how they do it.
 * Second that wiki has basically a copy of wikipedia, many of the stuff i dont think its been use or its even needed
 * Internet Explorer bug fix
 * Interwiki links to featured articles
 * Main Page layout fixes
 * pageview counter
 * "Technical restrictions" title fix
 * Add dismiss button to watchlist-message (if you want to keep it but i dont recomend it unless you are or have core page watchers)
 * Numeric sorting (this if you want keep it)
 * Main Page deletion image
 * Change Special:Search to use a drop-down menu
 * Geo-targeted watchlist notice
 * Sysop Javascript
 * WikiMiniAtlas
 * function PngFix
 * Those where a list of all the ones you should delete you will not use it, and many have things store on other pages that you dont have or are simply not available at wikia
 * and for Monobook.js revert your edit back. since you are duplicating part of the common.js content and also serves nor purpose since they cant load properly
 * for collapse table you only need the following sections:
 * Test if an element has a certain class
 * Collapsible tables
 * Dynamic Navigation Bars (experimental)
 * --Cizagna (Talk) Central Dofus 02:00, 24 February 2009 (UTC)

I seem to have fixed the JavaScript issue that was hiding the show/hide buttons. However, the text, like it does on Wikipedia and other sites that use collapsible tables, does not fill in the empty space when the table is collapsed. --DaNASCAT 03:51, 24 February 2009 (UTC)


 * Edit: Found an end around. Thanks to everyone for their help! --DaNASCAT 04:13, 24 February 2009 (UTC)

Also, on the Site Notice, is there a way to turn "dismiss" off, instead perhaps making the message collapsible instead of dismissable? --DaNASCAT 04:54, 24 February 2009 (UTC)
 * You can make it collapsible simply by putting the message in a collapsible table. Though I don't know if you can turn its dismissable feature off, since it is enabled by mw:Extension:DismissableSiteNotice. -- ko isuru ( talk ) 08:49, 24 February 2009 (UTC)


 * Well, I ask because MediaWiki Commons has a Sitenotice up that is not dismissable. Though they probably have messed with their MediaWiki code to make that possible. --DaNASCAT 15:55, 24 February 2009 (UTC)


 * its more like Wikia has mess with its own MediaWiki by installing dismisable Site Notice Extension --Cizagna (Talk) Central Dofus 16:49, 24 February 2009 (UTC)
 * That's what I'm trying to tell you. MediaWikis have sitenotices that are not dismissable, and they make it dismissable by installing the DismissableSiteNotice extension. By the way, what Commons are you talking about? Wikimedia Commons has theirs installed. -- ko isuru ( talk ) 04:16, 25 February 2009 (UTC)


 * Hahaha, silly me, perhaps if I had logged in, I would have noticed the M. Commons message is also dismissable. So it is impossible to post a site notice on a Wikia wiki without it being dismissable? Like, there's not a separate file or a "tag" or anything that will prevent the message from being dismissable? --DaNASCAT 06:36, 26 February 2009 (UTC)
 * And like we have been trying to explain you the answer is "no" by MediaWiki, you can do it by creating a JavaScript hack to insert a text but will be messy, and if you want them to keep popping out you just have to keep changing the MediaWiki:Sitenotice id (this number goes in to the cookie where its store if the number [sitenotice id] has been mark as dismiss if so it dismiss other way keeps showing) every now and then --Cizagna (Talk) Central Dofus 15:22, 26 February 2009 (UTC)


 * You could make it un-dismissable just by hiding the dismiss link, with this CSS:

/* For true CSS2.1 compat browsers */ display: none; }
 * 1) mw-dismissable-notice > tbody > tr > td + td {

/* For IE */ display: none; }
 * 1) mw-dismissable-notice td a {

display: inline; }
 * 1) mw-dismissable-notice td td a {
 * --Ciencia Al Poder (talk) -WikiDex 18:51, 26 February 2009 (UTC)


 * Ciencia, thanks for the code! It works fine dismissing the Dismiss message. the trade-off, however, appears to be that any form of site links (image, internal links, external, go missing as well. This only applies to logged-in users; not anonymous ones. --DaNASCAT 19:56, 26 February 2009 (UTC)


 * Sorry, I thought the table structure of the sitenotice on commons was the default. If you put the sitenotide message inside a &lt;div&gt; this should work:

/* For true CSS2.1 compat browsers */ display: none; }
 * 1) mw-dismissable-notice > tbody > tr > td + td {

/* For IE */ display: none; }
 * 1) mw-dismissable-notice td a {

display: inline; }
 * 1) mw-dismissable-notice td div a {
 * --Ciencia Al Poder (talk) -WikiDex 21:51, 26 February 2009 (UTC)


 * Oi, sorry to be a pain in the side, Ciencia, but I had the original code in  and the last thing you might have seen on the site was just me having messed around testing how it worked and didn't work. This is my current site notice, which, as compared to what shows up as the message (for logged-in users anyway) doesn't include the images or links.  --DaNASCAT 05:15, 27 February 2009 (UTC)


 * Because you are still using my first CSS example instead of the second --Ciencia Al Poder (talk) -WikiDex 17:54, 27 February 2009 (UTC)


 * My apologies, I didn't notice the subtle code difference at first glance. Everything works fine now; thanks once again. --DaNASCAT 04:32, 28 February 2009 (UTC)