Drop Down Navigation Code Help-- I need help to add another level
PermalinkSpecifically, I'd like at least one more level down and for it to appear to the right of the menu. I'm not sure where all of the code is stored for the navigation, so if you'd like to see my code, please give me a tip on where to look.
thanks
Here's my code on my main.css (do I need to make edits anywhere else?)
/* Main Navigation */ #nav { height: 31px; overflow:hidden; border:1px solid #333333; } #nav ul { width: 940px; margin:1px auto 0; padding:0; list-style: none; line-height: 1; } #nav ul li { margin:0;
Thanks!
Looking through your markup, it seems that your menu has only 1 level (i.e., the main level and one sub-level, but no second or third level). You should make sure that
1) you actually have additional levels in your site map
2) go into edit mode, click on your nav block, and make sure that you have these settings: display pages="at the top level", sub pages to display="display all", sub page levels="display all"
Hopefully the above will get the submenu markup to show.. then we can tackle getting suckerfish to play nice, if it doesn't automatically...
cheers!
I do have additional levels, so that's not the issue. I don't have the ability to select the nav block in edit mode-- it's not an editable item (nor am I using any other navigation blocks anywhere on the site (autonav, etc).
I tried looking around for some other files on the back-end that seem navigation-related, and did find this, so I thought I'd point it out (path, then code that's within the "dropdowns.js" file:
packages/theme_corporateamerica/themes/corporateamerica/js/dropdowns.js
<!--//--><![CDATA[//><!-- sfHover = function() { var sfEls = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); //--><!]]>
The script you mention shouldn't affect how many submenus display, because it just applies css style to the "active" menu - all the styling for submenus is handled in css by the :hover pseudoclass.
I guess you hard-coded the menu into your theme files. Is there a reason you did that instead of using the autonav block?
As I say, we can't work on getting 2nd and 3rd level submenus to display until the markup for them is in the page.
Hope this helps...
I didn't hard code the navigation in, it came that way with the theme. I got your PM, but I'm not sure what I'm supposed to do with it... Can you let me know what you were thinking?
I now see in your sitemap that you do indeed have pages in 2nd and 3rd levels... I guess they're somehow not being rendered in the theme.
Now that I think about it, your theme probably has a hard-coded autonav block in the theme files, and this autonav block could specify to show only one level.
I guess I'd recommend combing through your theme files (<site_root>/themes/<name_of_theme>/) and looking for the part that generates the menu (it might be in view.php). Then look at the configuration options of the nav block.
If you're not comfortable doing that, or don't know how, I could look at it for you. PM me with FTP info for your site.
Several older desktops: XP Running IE 7.0.5730.13
http://www.builtfromsource.com/2006/10/23/a-fix-for-suckerfish-drop...
in your case, the CSS should be
#nav li:hover, #nav li.sfhover { position: static; }
http://www.htmldog.com/articles/suckerfish/dropdowns/...
for how to add CSS that will make multilevel menus work nicely.