Forum:Bugs in dynamic navigation

Dynamic navigation used to hide menus like this right. Well, it works, but does not work correctly. In my language, show means "Mostrar" and hide means "Esconder". But the only word is "Esconder" when clicking. Well, look at this template in my wiki and you will understand. 00:21, April 9, 2010 (UTC)
 * Guys, help me, this template will appear on many pages, I made a picture for you to compare:

14:48, April 9, 2010 (UTC)


 * Copying over thing from wikipedia is not a thing that should be encouraged.
 * Instead use what is already awailable on Wikia.
 * >> http://dev.wikia.com/wiki/ShowHide
 * — TulipVorlax 15:04, April 9, 2010 (UTC)


 * It worked. But how do I change the show/hide words for my language? I think you should not understand my language, is Portuguese (pt-português) and this is the translation:


 * Show: Mostrar
 * Hide: Esconder

MediaWiki:Common.js of my wiki. Thanks 17:36, April 9, 2010 (UTC)


 * That Button lable code is contained in a .js file according to wikipedias help page for navigation / collapsible templates. Here - Try updating your local version with your language version.


 * Wikipedia templates are not 100% compatable with wikia but most do now work (with some updating of links and other bits of code). when i first started on wikia I had big problems as i tried to copy lots of them with wikipedia pages and they would not work due to the Parser function being different (with help i got a work round to work to create the V.D.E buttons to operate on the Navigation box template).


 * Another problem is so many templates are nested on wikipedia, so it is hard to track were the problem is (especialy if the doc pages are added as well, as the examples call other templates) - BulldozerD11 19:06, April 9, 2010 (UTC)


 * - Its in the common.js you linked to above, in the 3rd main section down

(navigation bars) section

// set up the words in your language var NavigationBarHide = '[Hide]'; var NavigationBarShow = '[show]';

Change the code to if you have admin acces to the page.(if not you need an admin to edit the file) or to get it to work just for you edit your own JS file as per wikipedias help section. // set up the words in your language var NavigationBarHide = '[Esconder]'; var NavigationBarShow = '[Mostrar]';


 * Think thats it if I've undertood the Question correcly - BulldozerD11 19:20, April 9, 2010 (UTC)
 * I think the codes of Wikipedia do not work on Wikia because is a project of the Wikimedia Foundation.

The code did not work, look. Look the common too. 21:08, April 9, 2010 (UTC)


 * There might be conflicting scripts. You need to remove anything related to show/hide except the three lines

var NavigationBarHide = '[Esconder]'; var NavigationBarShow = '[Mostrar]'; importScriptPage('ShowHide/code.js', 'dev');
 * (plus any comments you want to keep). The import line gets the script from its page on w:c:dev, the two other ones change the names of the buttons. And that's all you need. 23:02, April 9, 2010 (UTC)


 * It appears to work for me now - the cache had not cleared as when i went back again after refreshing it had changed to the portugese version. But Ose is better qualifed than me to fix JS code, so i will leave hime to it as i'canot read it in detail. So over to Ose.


 * The core code for wikia and wikipedia is the mediawiki/wiki-media software, but the 2 sites are customiseing and refining it to suit there differing needs as the sites develope. The original code was writen for wikipedia and released through the Wikimedia foundation. Both wikia and wikipedia were founded by Jimmy Wales, but wikia is not conected to the Wikimedia foundation (a not for profit organisation with charity satus. Wikia is a comercial operation, funded by the adverts, and using the same opensource wiki software (but customised). (Thats a summary as i understand it, but staff may clarify it if i'm wrong) - BulldozerD11 23:19, April 9, 2010 (UTC)


 * Wait, I have to copy this code or this code? Or both? 00:20, April 10, 2010 (UTC)


 * Neither according to user:Ose as he is sayng that in the JS file there is a link that calls the code in the Wikia development wiki. See his reply above mine You just need the customised language bit aparentlly and the call to the other wiki with the code. most of the other suff is not needed -


 * One of the advantages and problems with wiki software is there are several ways of doing things so it can get confusing. You may be best talking to Ose by leaving a nessage on his talk page asking him to explaine just what is needed and what can be removed, Sorry canot help more - BulldozerD11 02:56, April 10, 2010 (UTC)

You dont need to copy the js file ; the line  importScriptPage('ShowHide/code.js', 'dev');  do it for you using a link, sort of. — TulipVorlax 03:00, April 10, 2010 (UTC)

With, of course, the two lines that Ose showed to change the language to Portuguese. Otherwise we'd be back to square one. ;) The 888th Avatar   (talk)  03:45, April 10, 2010 (UTC)
 * I put the following:

importScriptPage('ShowHide/code.js', 'dev'); var NavigationBarHide = '[Esconder]'; var NavigationBarShow = '[Mostrar]';

But it did not work, because the buttons my language are at the top of the page and hide/show continues in the same place, look. 03:51, April 10, 2010 (UTC)


 * I think the import line needs to be below the variables for the words to change. And I see no buttons on the top of the page. 10:05, April 10, 2010 (UTC)


 * Dont know what every body else is seeing but I see a std Navbar outline with the show/Hide at right hand side (in portugese) that expands the box / colapses it when clicked. But the bar also has the text [Hide] next to the variable on the bar (this does nothing) ? PS Dont see wikipedia style tabs but believe thats down to choice of Skin. - BulldozerD11 11:37, April 10, 2010 (UTC)


 * The import line, per Ose, needs to be under the variables for the words to actually appear in Portuguese.
 * I see the show/hide buttons, but they're right in the centre, next to the title, which suggests that something is up with the NavFrame stuff you've put in Common.css. (Copied from Wikipedia?) If you use a table,


 * it may actually be easier to code for you. The 888th Avatar   (talk)  12:42, April 10, 2010 (UTC)


 * In common.css I did not put in anything, I put in common.js this:

importScriptPage('ShowHide/code.js', 'dev'); var NavigationBarHide = '[Esconder]'; var NavigationBarShow = '[Mostrar]';

If I put this on a page: (Header) (Content)

It is this way, but hide / show are not bold and color of the header is different: (Header) (Content)

And I use the MonoBook theme. 17:42, April 10, 2010 (UTC)


 * I fear that the Wikia version, the one where you add 3 lines to the .js file, does not come with a defaut style; you must add the style you want. This can be done in common.css or directly in the template. — TulipVorlax 21:47, April 10, 2010 (UTC)


 * Mateus, the order you're putting it in Common.js still looks wrong; you need to put the languages first. ;) You do have something in Common.css, I looked - just copy what I have in my monaco.css and replace anything that looks similar in your Common.css, and the navigation toggle buttons (show/hide) will show in the right places (I checked). Once both are done, the whole thing should be fixed. The 888th Avatar   (talk)  23:14, April 10, 2010 (UTC)
 * It did not work... <:(


 * http://pt-br.desinformatica.wikia.com/wiki/MediaWiki:Common.css 00:20, April 11, 2010 (UTC)