Last updated August 10, 2009. Created by flaviovs on May 13, 2009.
Edited by bekasu. Log in to edit this page.
Nice_menus 2.x has a nice (no pun intended) feature: the ability to set the starting and ending menu level for displaying the menus. For instance, there's no need to buy a 27" monitor to show your 8-levels menu anymore, if you use the 2.x version.
Unfortunately, the 2.x version is a development version as of May 2009. Many webmasters (me included) are not confortable of using a "-dev" module on their production site, so they are stuck with the 1.x version which doesn't not offers that feature.
Not anymore. The presented hack make nice_menus display menus only to a specified level using the 1.x version. Here's what you need to do:
- First, find the class ID for your menu. In our example, let's suppose the menu ID is
nice-menu-0 - Now edit your
style.cssand add a block to hide the desired level of menus using CSS. For example, to show menus only to the second level use:.nice-menu-0 li ul li ul {
display: none;
}E.g. to show menus up to the nth-level, repeat the "li ul" n times.
Notice that this is just a workaround. The entire menu structure is output on the HTML, so non-CSS browsers will display the full menu structure. Also, search engines and robot-like programs will see your entire menu and probably will follow the links it points to.
Also, it's not possible to specify a starting menu level using this CSS hack, so don't ask for it. If that's what you need, then wait for the "-dev" version to become stable, or for some brave soul to backport the patch to 1.x.
This hack was tested on the Amity Island theme. There's no reason for this not work on other themes, but YMMV.