Board Thread:Support Requests - Getting Technical/@comment-2170536-20130901071607/@comment-2170536-20131013005007

Hello all,

I just wanted to thank Penguin-Pal again for his help in getting the extended navigation to work. I'm pleased to let everyone know that I've added the capability for this code to take advantage of reading the MediaWIki:Wiki-navigation file so you can easily add fourth- and fifth-level navigation to your own wikis without having to write extensive JavaScript.

Any administrator can add this functionality to their wiki by importing the following JavaScript file:

'w:c:clashofclans:MediaWiki:Common.js/SubNav.js'

Then simply import the following CSS stylesheet by adding the following line to your MediaWiki:Wikia.css file:

@import url("http://clashofclans.wikia.com/index.php?title=MediaWiki:Wikia.css/SubNav.css&action=raw&ctype=text/css");

Finally, you can change the look of the menus so they match your current color scheme with the following CSS (replacing #25883D with your own color code):

.subnav-4 { border-color: #25883D; }

.subnav-5 { border-color: #25883D; }

.chevron-right { border-left-color: #25883D; }

When adding level 4 and level 5 submenus, simply edit your MediaWiki:Wiki-navigation file as usual, and use '****' to designate level 4 submenus and '*****' to designate level 5 submenus. Wikia will ignore the extra lines, but the custom JavaScript will add the higher-level menus where appropriate.

A couple of things to note:
 * 'Preview' mode does not load any custom JavaScript, so only the Wikia-generated (i.e. levels 1-3) menus will appear there.
 * Publishing the Wiki-navigation does not re-load the custom JavaScript either. Any previously-generated menus will be there, but your changes will only appear once you have refreshed the page (or browse to a new page). So in order to see level 4 and 5 menu changes, hit Preview, then Publish, and then F5 (or your preferred method for refreshing the page). Clearing the cache is not necessary.
 * You may only increase the submenu level by 1 level at a time (just like with the normal Wikia-generated menus), i.e. you can't have a level 4 submenu immediately following a level 2 submenu.
 * If you wish to add a level 4 submenu, the level 3 menu it attaches to must be unique. Either the link itself must be unique, or if you have used   to identify a menu item with no link ('#'), the display name must be unique. The code uses a JQuery .find method to attach the appropriate HTML, so if the level 3 submenu is not unique, it will attach the menu to every instance it finds.

If there's a place I should put this code to make it more readily available, please let me know.