I'm trying to do Sliding Doors with Suckerfish on Nice Menus and failing miserably. What I'd like to do is to give the top-level LI's a subclass of "tab" so that only they receive the background image, and the children will just have a color; however, nothing I do seems to allow that. Is this a feature that either a) can be added, or b) is intended to be added? It seems like a common-sense thing, but I can't find it anywhere.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 508690.nice_menus.depth-class.patch | 2.04 KB | joachim |
| #9 | nice-menus-add-item-depth-1.patch | 1.89 KB | amitaibu |
Comments
Comment #1
maryannking commentedSliding doors require span tags around the menu item -- to view, check my development site: http://mngastro.advantagelabs.com (I am using sliding doors for angled tabs)-- added the function theme_links to the template.php file to add the span tags to the menu links
my difficulty is with the last dropdown.
Comment #2
maryannking commentedSliding doors require span tags around the menu item -- to view, check my development site: http://mngastro.advantagelabs.com (I am using sliding doors for angled tabs)-- added the function theme_links to the template.php file to add the span tags to the menu links
my difficulty is with the last dropdown.
Comment #3
naught101 commentedIdeally, it would make sense to have a different class for each level. ie. nice-menu-level-0 for top level, nice-menu-level-1 for the first child, etc.
As a work-around, you can do this:
If you need more levels, just add more "li"s.
Comment #4
naught101 commentedComment #5
danigrrl commentedI agree with this. If we just had a class called "top-level" or something that was specific to the top level of the menu, that would be perfect, since I think there's already a "children" class on the sub-menus. What I'm experiencing is that the settings I'm putting for the top-level li's are passing down to the children, no matter what I try to do, and the hover state on the top tabs disappears when you move on to the dropdown.
Comment #6
naught101 commenteddanigrrl: did you try "#block-id .content>ul>li"? it works fine for me... although not in ie6, 'cause ie6 is crap: http://www.webdevout.net/browser-support-css#css2selectors . Thankfully, it's on its way out.
Comment #7
add1sun commentedNice Menus is already spitting out a fricking ton of CSS selectors, but I can see how this could be useful in some use cases. The only way it would be considered as a new feature though is to have a patch against the dev version.
Comment #8
add1sun commentedHeh, someone created a separate issue for this with a patch: #797692: Add menu item depth to LI I've marked that one a duplicate, so let's keep the discussion over here, but please try that patch and see if it works for you.
Comment #9
amitaibuI've attached the patch here, for easier testing.
Comment #10
PMorris commentedThanks for posting this. I was having a hell of a time gettin Cufon to select the top level menu only for font replacement (despite me having the knowledge to do it with css)
This worked perfectly
Comment #11
enap commentedI had to implement this feature (depth based classes), however I was using Drupal 7 & nice_menus-7.x-2.0beta2. I didn't really want to patch the module itself (also patch is for D6 version) but found I could use a theme hook to achieve the same result. I used parts of the provided patch in #9. This may not be the correct approach, but it works :):
Put into your theme's template.php:
Comment #12
joachim commentedThe class needs a space at the end to be consistent (though for later, see #1124728: use implode() on classes rather than muck about with spaces).
Reworked the patch.
Comment #13
deviantintegral commentedComment #14
caspervoogt commentedHere's what I use, which is currently working with the latest release. The previous code wasn't rendering the menu at all for me.
Comment #15
caspervoogt commentedmarking fixed since no word from danigrrl or others.. and we're now on version 7.x-2.5 anyway. Reopen if needed.