Closed (outdated)
Project:
Imagemenu
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
28 Nov 2008 at 20:49 UTC
Updated:
27 Jun 2018 at 17:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
headkit commentedyou are the man, starting the right issue.
i am very interested!
thanx!
Comment #2
headkit commentednothing new here?
i need this really quick.
i would also pay some money if someone clears this request.
Comment #3
gaia commentedoh, i need this feature as well.
Comment #4
awolfey commentedHere is a patch that adds the classes current and active-trail to the active menu item. I have it working but have not thoroughly tested it.
This does not set the active image to the rollover image, but it does let you do other things. I used it with the lavalamp jquery menu to set the active item.
Comment #5
awolfey commentedHere's a patch against imagemenu.module 22 Apr 2008 15:06:16 -0000 1.7.2.2
This sets the active menu item image to the rollover image, and the rollover to the original image.
It also includes the added classes from the above patch.
Working for me, but needs testing without clean urls and various other front page settings, aliases, etc.
Comment #6
awolfey commentedOops. Use this one instead. Patch in #5 does not switch rollover to the original image.
Comment #7
tunicI have the same problem, and this patch seems to fix it. I'm using clean urls with pathauto, multilingual site with language prefix (URLs like http://mysite/en/exampleContent and http://mysite/es/contenidoDeEjemplo) and awolfey patch works fine, at least for the moment.
Thank you very much, awolfey.
Comment #8
kla2t commentedCertainly the patch is an improvement of the imagemenu module, but actually it seems to work only partially for me. The classes "current active-trail" are added to nothing but the lowest active menu level. Example: If I have a page with the URL "projects/type/residential", only the "residential" entry at the last of the three menu levels is highlighted by the active-trail property, but neither "projects" nor "type". This is not what I would call a trail...
Is it possible to set the active-trail class to all parent levels, too? Maybe it does not work properly because my paths don't correspond to nodes - they are generated by different views (one for "projects", one for "projects/type" and so on).
Any help will be highly appreciated!
Comment #9
awolfey commentedkla2t: Unfortunately I don't have time to figure this out with views. You might look at http://drupal.org/project/menutrails and see how they do it. Also see http://drupal.org/node/340725. I got this working with normal menus, but I did not need it for imagemenu.
Comment #10
kla2t commentedThank you, Aaron. I tried Menutrails, too, but I couldn't get it integrated with Views plus Imagemenu. It seems that I will drop the whole Imagemenu thing in favor of Nice Menus. The latest dev version assigns not only unique IDs to each menu entry, but also active-trail classes to all parents of the current entry. Thus, you can create graphical menus by CSS along the lines of http://drupal.org/node/209989 - with individual background images for menu entries and invisible (but readable) text. This is not a very flexible, but apparently a working solution.
Comment #11
kla2t commentedComment #12
Anonymous (not verified) commentedpatch #6 does not work with url aliases
menu path | page alias
--
node/2 | node/2: OK
node/2 | content/biography: NOT OK - patch #6 does not check that this alias is in fact "node/2" and consequently fails to keep the menu active
Comment #13
awolfey commentedI have not looked at this since first posted in March. The project I used it for ended up with another menu option. I can try to look, but if someone else is using this now, please don't wait for me to get to it.
Comment #14
kunago commentedI tried to fix the patch provided in #6. This one is working for me in all situations.
Comment #15
lee20 commentedI just tested the patch in #14 against version 1.1.
Works great!
Although the use of "active-trail" doesn't work as it should. The active-trail class should be applied to the ancestors of the active item. But the active trail is only assigned to the active item and not to the ancestors, which is not a true indication of the active trail. But this should probably be requested in another issue as it is beyond the "active state' request?
Comment #16
richard moger commentedThanks worked a charm. One small issue, doesn't work for a homepage imagemenu item, sure I'll get round that though.
Comment #17
richard moger commentedUpdate. Added line below to my codebase for my use case of homepage having it's own imagemenu item. Patch isn't setting the image path to the rollover one so homepage image wasn't being set correctly when homepage active.
p.s. about as small as you can get but my first drupal contrib!
Comment #18
kunago commentedI updated my own patch so posting another one. I minified the condition for $item_path from many lines to one single line and have also fixed the drichar's issue with front page. It works for my menus.
Give it a try.
Comment #19
gambiteer commentedworks for me
Comment #20
marcus_clements commentedThanks for the patches.
I've added active-trail class to list items and active class to links when appropriate. I took out "current" because Garland doesn't put it in - is it necessary?
I've made a setting to choose whether or not to set the rollover image as the active state.
The active-trail class is still not applied to the relevant list items higher in the menu tree. If anyone wants to supply a patch to do that I will happily include it.
The changes will be in the nightly dev snapshot. Please test and review.
cheers
rayvaughn
Comment #21
kunago commentedI was working on the "active" state while ago but after couple of hours I had to give up. It was not working. For the inspiration I looked at the menu module and found out the way to set the active state for even child items would require a major redesign of the Imagemenu module.
Comment #22
Alex Andrascu commented#20 it's working fine on my side
Comment #23
bluesherpa commentedHow can the rollover image be used as the active menu option? I have the latest dev version of imagemenu installed. The notes say the feature is now possible. I'm just not sure how to take advantage of it.
Thanks =)
Comment #24
mvalverde commented... the Problem still seems to remains with version 6.x-1.3 and even with the latest dev version.
We're using "image menu" in combination with "menu trails".
When switching to the garland theme which is not using "image menu" the active trail and active css classes are properly set on the menu item.
When using our production theme with "image menu" those classes were not set in exctly the same situation.
THX!
Marco Valverde, explido Software
Comment #25
susanb commentedI have two imagemenus on my site.
on menu #1 - I want to use the 'rollover image for active menu item'
on menu #2 - I do not want the rollover image to be used for the active state!
Anyone know how to do this easily?
Thanks in advance!
Comment #26
pobster commentedClosing as D6.x is now unsupported.