FANDOM


This Forum has been archived

Visit the new Forums
Forums: Index Community Central Forum Need help with ShowHide script
FANDOM's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.

50px-Replacement filing cabinet.svg

Note: This topic has been unedited for 1190 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.

Hi, since the new skin was launched, the ShowHide script doesn't work in

I already read some forum threads and the script's talk page, but wasn't able to fix the problem yet.

Please help! --Weas-El (Talk) 14:31, January 9, 2011 (UTC)

Show/Hide now works on the Cannabis Wiki with the Oasis skin. See:
The various related Show/Hide pages are out-of-date, and some of the JS and CSS is screwy too in my opinion. Multiple pages are involved. Some developers commenting in that thread said that they haven't been updating things. I managed to get it working again on the Cannabis Wiki. I adapted the CSS to my preferences.
I got the JS working in my wiki, and some CSS to work with it. You need both JS and CSS, I believe, for Show/Hide to work correctly. Here is the JS and CSS I use:
The JS is a single line that imports it from elsewhere:
importScriptPage('ShowHide/code.js', 'dev');
It imports it from here:
http://dev.wikia.com/wiki/ShowHide/code.js
The relevant CSS that I use is at the end of the CSS page:
It starts with
/* Standard Navigationsleisten, aka box hiding thingy from .de. */
Feel free to copy the CSS. You can see how I implement Show/Hide here:
http://cannabis.wikia.com/wiki/Category:Collapsible_box_templates
Look at the wikitext for some of the collapsible tables to see how it is actually implemented on the wiki. --Timeshifter 20:59, January 9, 2011 (UTC)
Hi Timeshifter, thanks for your answer. I just successfully created a collapsible table using your code. :-) --Weas-El (Talk) 21:18, January 9, 2011 (UTC)
Great! I guess you figured out that the collapsible table CSS also has to go in Wikia.css:
It used to be sufficient to add CSS only to Common.css to effect all skins. Now Common.css effects all skins except the Oasis/Wikia skin.
Adding JS to Common.js still effects all skins including the Oasis/Wikia skin.
Fandyllic suggests getting collapsible table code from here:
Later note. See: Forum:Common.css for a way to import Common.css into Wikia.css. There is no need to duplicate the CSS. --Timeshifter 20:00, January 27, 2011 (UTC)
Use Wikia.css instead of Common.css, right. I looked around Cannabis-Wiki to see how you create a collapsible box in articles. I created a table like this then:
{| class="testbox mw-collapsible mw-collapsed"
! Heading
|-
| Content
|}
and defined the style for class "testbox" in Wikia.css. Am I right, that it works for tables only, not div block elements? Or did you create the boxes in a different way?--Weas-El (Talk) 11:53, January 10, 2011 (UTC)
I have a template that simplifies the page by not using lots of html code within the article page and creates a box to wrap the text that collapses code here (based on a wikipedia template), which uses the class= Navbox collaspible function from the navbox code. The template can have the header colour and caption changed and the default state set. (note - the documentation uses a fair number of other templates if copied 'as is'). This is working under oassis. Internally it creates a one cell table. the content text could be passed as a parameter into it and the separate clossing template 'removed' but that would then complicate editing of the text for RTE users on the wiki (but also help protect quotes from changes by 'new' editors). -   BulldozerD11   talk    contribs    email   14:04, January 10, 2011 (UTC)
Weas-El. I don't understand JS code at all. I understand a little about CSS. As to how it all relates to tables and div blocks, I am clueless. My understanding of HTML is pretty basic. I understand a fair amount about table wikitext. One thing that might help in your testing is to use this personal CSS page (adjust URL for your user-name and wiki):
http://cannabis.wikia.com/wiki/User:Timeshifter/wikia.css --Timeshifter 22:14, January 10, 2011 (UTC)
Alright, nevermind. It works now in one wiki, and I'll do the same changes in the other wiki later. Making it work is the only thing that counts. :-) Thank you, both of you, for your help. --Weas-El (Talk) 23:04, January 10, 2011 (UTC)

(unindent). The CSS currently used on the Cannabis Wiki for collapsible tables was adapted from the CSS found here:

There is a way to avoid duplicating the CSS in Common.css and Wikia.css. The CSS can be imported into Wikia.css from Common.css. See Forum:Common.css for the how-to info. --Timeshifter 19:57, January 27, 2011 (UTC)
Community content is available under CC-BY-SA unless otherwise noted.