Forum:Show/Hide Problems

Hello. So, show/hide enabled by javascript has decided to stop working on my wiki. The other scripts on the Common.js page are working fine though, so I'm not sure what is going on. An example template. Are there any suggestions as to what I can do?

Thank you,

-- 03:31, September 20, 2012 (UTC)


 * Show/hide has stopped working on my wiki too. For example; all the show/hide boxes are normally closed initially on the main page:
 * http://cannabis.wikia.com/wiki/Main_Page - but now they are all open.


 * Show/hide comes from JS and CSS here:
 * http://dev.wikia.com/wiki/ShowHide/code.js
 * http://cannabis.wikia.com/wiki/MediaWiki:Common.js
 * http://cannabis.wikia.com/wiki/MediaWiki:Wikia.css --Timeshifter (talk) 06:06, September 20, 2012 (UTC)


 * Yes, this is a known issue that has also been reported at the Dev Wiki on w:c:dev:Talk:ShowHide. Unfortunately, the code page is locked, so even some people who might be able to fix the problem can't edit it. If you want this script fixed, your best bet is to contact User:Grunny of Wikia staff who has been maintaining ShowHide. Needless to say, depending on what the issue is / when Grunny gets around to it, this script might not be fixed quickly.


 * Regardless of when/whether the script is fixed, you are highly advised to phase out usage of the ShowHide script and instead use the built-in collapsible capabilities in core MediaWiki software, which are now available since Wikia has finished upgrading to MW 1.19. Example:




 * Very well. There aren't so many affected templates that it would be too much of a hassle to incorporate the newer method. Done for this template. In that case though, is there anyway to alter the new show/hide button to match the older appearance (white text, not bold)? Also, is there anyway to get rid of the brief "flashing" (for lack of a better term) sequence that occurs when the template is opened?


 * Thank you,


 * -- 07:14, September 20, 2012 (UTC)

1) Actually, if you check the Dev Wiki, Grunny has fixed the script now. It may not update immediately because of caching though, so you might not see it working immediately. That was an extremely fast fix though :) -- The point about using mw-collapsible still stands, you can see that Grunny is encouraging people to stop using ShowHide.

2) White text / not bold -- you can write CSS to put in your MediaWiki:Common.css for that. I'm not exactly sure what you want, but you can try this for starters:

3) Brief flashing: No, this cannot be changed.


 * I had discovered it was working again actually (on the last template I was changing, of course). The css code you've given me works fine. Now, I hate to be a bother, but is there anyway I can set different colors for different uses of show/hide? White works for the most part, but in some instances, it has rendered the text invisible. For my wiki's Template:Hidden, I've been able to alter the text only on that template by using a combination of this code in the template:


 * And this on the Wikia.css page.


 * Could I use something like this with mw-collapsible?


 * -- 07:53, September 20, 2012 (UTC)


 * Absolutely, this same kind of approach will also work with mw-collapsible. All you have to do is something like class="mw-collapsible mwCollapsibleAltered" for the table itself, and then the following CSS for the button for JUST the one table that is using mwCollapsibleAltered class:


 * The .mwCollapsibleAltered .mw-collapsible-toggle a selector has higher specificity than the .mw-collapsible-toggle a selector, so it will override the other CSS which I gave you above, causing the link for that one particular table to be blue/bold font instead of the "default" white/normal font which it would otherwise have from the CSS I gave you above.


 * Okay, I've worded this badly. The Template:Hidden was just an example. It doesn't (to my knowledge), use the mw-collapsible class. It should not be affected by the CSS you gave me.


 * What I wanted to know, was if there was anyway I could create something like what I did with Template:Hidden, so I could change the colors of certain instances of the show/hide button used in the new tables. Have I phrased that any better?


 * -- 08:51, September 20, 2012 (UTC)

You have a list of templates ("certain instances") that need to have a differently colored button than the default white? Then simply add a class to them (I used mwCollapsibleAltered above) and write the CSS to make their color what you what, like I suggested. Live example: http://mathmagician.wikia.com/wiki/Collapsible_tables?oldid=5739