Needs review
Project:
Menu Icons
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Aug 2011 at 06:36 UTC
Updated:
13 Oct 2015 at 04:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Screenack commented+1
Comment #2
acrollet commentedI think this is a nice idea - I'm currently more focused on stamping out bugs and working towards a 3.0 release, but would welcome a patch.
Comment #3
acrollet commentedUpdating version.
Comment #4
Anonymous (not verified) commentedHow about this patch? To be applied on the dev version. I know it can be made more DRY, but it works on my side so far.
The extra template file menu_icons_css_item_hover.tpl.php has the following content:
-Thomas
Comment #5
Anonymous (not verified) commentedAnd before I forget, the extra template file that is needed. I also forgot to remove two dsm() 's. Been a bit too fast.
Comment #6
Anonymous (not verified) commentedSmall addition to the extra template file, active menu items with active-trail
Comment #7
acrollet commentedThanks very much for the contribution - could you roll it all together as one patch, and follow the Drupal coding standards? (particularly as regards whitespace) This will make the patch easier to review and integrate.
Comment #8
Anonymous (not verified) commentedI'll see what I can do. I don't have much time left at the moment.
Comment #9
ace11 commentedReally waiting this extremly necessary feature.
Comment #10
Anonymous (not verified) commented@acrollet: can you please point out where my patch does not meet the coding standards?
Thanks
Comment #11
acrollet commented@elfenixtorres: there are several lines with extraneous whitespace, and your editor appears to be set to use tabs instead of spaces - please see http://drupal.org/coding-standards#indenting. If you can get time to re-roll this as a complete patch against the latest git checkout, I'd love to get this in.
Comment #12
Anonymous (not verified) commented@acrollet: thanks, that's strange, because both my editors are set to use 2 spaces, just lik in that guide. Perhaps it's an issue with the program that creates the patch. I'll see what I can do when I find some time.
Comment #13
tsi commentedHere is a re-roll of this feature with some small fixes, mostly it's the same as #4
Comment #14
tsi commentedmmm... the new tpl (see #4) didn't got in the patch. will have to add it manually.
Comment #15
acrollet commentedUnfortunately this patch does not apply, there have been some changes to the codebase since it was uploaded. I'll be happy to review if it's re-rolled.
Comment #16
drupallerinaI rerolled the patch!
Not tested yet, though.
Comment #17
drupallerinachanging issue status
Comment #18
drupallerinathis patch includes the template, ignore previous one
Comment #19
deanflory commentedSo, does this patch use one menu icon for each state or just one for all states?
Thanks for any clarification as it either makes my life easier or it makes it more difficult (if patched and it takes over all states with only one icon).
Comment #20
drupallerinaAs far as I can tell, this adds the option to add a second image for the hover state. It also uses the hover image for active menu trails.
Comment #21
drupallerinaI just tested and noticed that the new hover image file upload field doesn't show up on nodeforms. (only in /structure/menu/item/217/edit)
Comment #22
deanflory commentedI've only noticed menu_icons settings on menu item edit pages, where they should be, and never on node edit pages. Pardon me if "nodeforms" are something I'm not aware of that are different from node edit forms.
Comment #23
ktrev commentedI have applied this patch..But still the image is not showing on mouse hover.I am using 7.x-3.0-beta4 version
Comment #24
drupallerina@deanflory: i was referring to the menu settings you get on each node admin form. where the publishing options are, in the vertical fieldset.
@revathykt the patch is against the dev version, try that and clear your caches
Comment #25
pixeldroid commented@drupallerina - missing hover icon field removes the hover icon on node save. Would you be able to adjust the patch to include it?
Comment #26
deanflory commentedWhat is the best way to preload these hover images in CSS, or Javascript, or other?
Is an active state going to be added? The hover works fine except for the non-preloading flicker.
Comment #27
pixeldroid commented@deanflory Active state is working fine.
Comment #28
deanflory commentedI'll try downloading the latest dev, applying the #18 patch and see if it shows up this time. I've only seen the normal and hover state options.
Yeah, the flicker is why I was asking about preloading.
Comment #29
pixeldroid commentedThe only glitch i have seen is that the hover image upload field is missing from the node edit form. It is on the menu edit form. If you upload the hover state icon on menu edit and then re-save the node - it removes hover state icon.
I had no time to duplicate hover icon handling on the node edit forms, so I went into the patched module file and disabled the sections that place menu icon upload fields into node edit forms.
Comment #30
deanflory commentedI just use the menu item forms to set-up menu icons.
Before I go back and redownload, repatch, reupload, run update.php and see if a 3rd image (active) is possible on a menu item, here are the only options I have now in a menu item edit form:
Path to the icon (normal icon, loaded and displayed upon page load)
Path to the hover icon (rollover/over/hover icon shown when the cursor moves over the menu item)
I'm not seeing a 3rd set of options (image style, path, upload) for active (mousedown/click/right-click hold) but will try this all again, just not going to uninstall this module and redo all that work on hundreds of menu items.
Looking at the code of the #18 patch I don't see much mention of "active" anywhere except related to active-trail which is not the same.
Here are the 4 link states just to clarify:
Can anyone else confirm the #18 patch adds two link states to menu icons (hover & active)?
Comment #31
pixeldroid commented@deanflory, it does add them. But you will have to do what I did in #29 in order to keep it working. The patch is unfinished. I will try to create a new patch that will work correctly.
Comment #32
deanflory commentedI have normal and hover icons working. My question was whether the active state can be added as I don't think it is, novice-ly skimming through the code. Active and hover are two different states. See #30 for more info.
Comment #33
pixeldroid commentedDo you mean you want an additional, different from hover state, active state for the link? Currently, active state = hover state for the icon. No quick way to add a separate active state to it without tweaking the module.
Comment #34
deanflory commentedYes, so there would be a normal, hover (over) and active (click-down/hit, right-click-down). Three different images if needed. Just to clarfiy, active state is different from active menu trail as it deals with hierarchy and the link's active state is only for that one link, though I'm not sure if active trail in superfish triggers an active state on all in the hierarchy.
I imagine most people wouldn't take the time to have 3 different images on one menu icon, nor would want the additional download size, but it can be useful and with the speed of most computers/devices and connection speeds increasing over time it will likely become more used as time goes on.
Comment #35
au_dave commentedI found that this patch didn't work when serving files from a cdn or S3 bucket as it put in the host name as the path to the hover image.
I have made a very small fix to the patch in 18 to generate the path to the hover image in the same was as the initial menu icon.
Comment #36
deanflory commentedPatch in #35 has a bad WSOD error, couldn't even get through the update.php process:
These are the two patches I'm currently using that work for me, but I'm not using a CDN:
These two together created the error, likely the new second one that produced the error:
Comment #37
au_dave commentedSpotted my error, 2nd attempt
Comment #38
deanflory commentedAfter applying patch "menu_icons-icons_disappear_after_edit-1437184-redo.patch" first:
patching file menu_icons.module
Hunk #8 succeeded at 483 (offset 3 lines).
Hunk #9 succeeded at 494 (offset 3 lines).
Hunk #10 succeeded at 567 (offset 3 lines).
patch: **** malformed patch at line 208: + // Support private filesystem
So there's an error in there.
Comment #39
deanflory commentedAfter applying patch "menu_icons-icons_disappear_after_edit-1437184-redo.patch" first:
patching file menu_icons.module
Hunk #8 succeeded at 483 (offset 3 lines).
Hunk #9 succeeded at 494 (offset 3 lines).
Hunk #10 succeeded at 567 (offset 3 lines).
patch: **** malformed patch at line 208: + // Support private filesystem
So there's an error in there.
Comment #40
barrapontoI found the same issues as @deanflory. Here is a rewrite of the patch.
Comment #41
maxplus commentedHi,
tranks to barraponto, #40 works great for me
Comment #42
deanflory commentedFYI, I somehow re-uploaded menu_icons with the #40 patch and hover images stopped working and were throwing tons of these errors:
I did not uninstall and reinstall the patched module.
Reverting back to the #18 patch has the hover state image working again.
When I had the #40 patch applied and updated in the site and the hover images completely stopped working, even when I edited an item and reapplied the image paths to a menu item, and flushed all caches, they still didn't work, so I'm not sure if #40 actually works, but it clearly doesn't after having applied #18 and just updating.