Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am using trim menu for all my sites. Please consider to update to D6. Many thanks.
Comment | File | Size | Author |
---|---|---|---|
#10 | menu_trim-d6.module.patch | 9.82 KB | Mark Trapp |
#6 | menu_trim-d6.module.patch | 9.62 KB | Mark Trapp |
#6 | menu_trim-d6.info.patch | 497 bytes | Mark Trapp |
Comments
Comment #1
DynV CreditAttribution: DynV commentedI will as soon as I have time.
Comment #2
dan_aka_jack CreditAttribution: dan_aka_jack commentedsubscribing...
Comment #3
sam6 CreditAttribution: sam6 commentedsubscribing
Comment #4
Mark TrappHello, Bear Brook (http://bearbrook.com) has sponsored a port of menu_trim to d6 which was just completed. Is there any interest in publishing it back to this module, or should I be looking at forking it and calling it something else?
Comment #5
David Lesieur CreditAttribution: David Lesieur commentedNo need to fork... Please submit your patch here for review by the community. Thanks!
Comment #6
Mark TrappPatch attached. Most of it is just changing the module to fit the d6 way of doing things, but the menu system rewrite in d6 obsoleted the easy ways to access root menus and submenus.
Comment #7
David Lesieur CreditAttribution: David Lesieur commentedThe patch applied nicely, but in my tests I did not manage to get the menu trimmed... I could not investigate much, but the following condition is always false in menu_trim_block('view'):
This is caused by menu_get_active_menu_name() always returning 'navigation' because no module has called menu_set_active_menu_name() to set my custom menu as active. Therefore, it looks like menu_get_active_menu_name() cannot be relied upon in D6 in the same way we did with _menu_get_active_trail_in_submenu() in D5.
Comment #8
David Lesieur CreditAttribution: David Lesieur commentedComment #9
Mark TrappAh, I see the issue: menu_get_active_menu_name() returns the menu that the menu item was added to last; so if you had a link in one menu, it'll show up in a Menu trim block, but if you added that link to a second menu, it'll work for a Menu trim block for the second menu, but stop working for the first menu.
I have a few ideas on how to account for this; I'll test them out and roll a new patch.
Comment #10
Mark TrappNew patch attached. I'm really disliking the new menu system in d6. From my testing, there does not appear to be a way to test if the path is in the active menu without traversing the entire menu (that is, it's only set as a property for the last menu set).
I've tested this with a custom menu, built in menus, menu items appearing in multiple menus, and other various checks, but any additional testing would be appreciated.
Comment #11
mlieshout CreditAttribution: mlieshout commentedAny news on this module? The latests patch doesn't seem to work for me (drupal 6.8 install).
Comment #12
David Lesieur CreditAttribution: David Lesieur commented@mlieshout: Can you provide more details on what doesn't work? Thanks.
Comment #13
mlieshout CreditAttribution: mlieshout commentedI followed the directions on how to configure the trimmed menu's but I get the whole primilary links menu twice. I can give you the url on pm if you want.
Thnx,
--
Maarten
Comment #14
mlieshout CreditAttribution: mlieshout commented@David
I had a chat with Amorfati, he's acknowledged that the patch isn't working on the d6 release due to the changes in the menu-router. He's trying to rewrite the patch so that it will work again.
Comment #15
David Lesieur CreditAttribution: David Lesieur commentedThanks for the update!
Comment #16
David Lesieur CreditAttribution: David Lesieur commentedWell, apparently the Menu Block module now seems to support most (if not all) of what Menu Trim used to provide. Its project page states:
This is great news. Can anyone report success with this feature in Menu Block?
Comment #17
mlieshout CreditAttribution: mlieshout commentedMenu Block can trim menus very easily like this:
Install Menu Block and activate it.
Then, on admin/build/blocks disable the default Primary links block.
Add two new menu blocks:
One for the first level of the menu, these are the settings:
Second one for the second level menus:
And activate the blocks.
I haven't tried this with more than 2 levels but it should be no problem.
Comment #18
faqing CreditAttribution: faqing commentedMenu Block can not replace Menu Trim.
Menu Block can not trim the items from the same level menu.
Please do to port Menu Trim to D6!!!
Comment #19
David Lesieur CreditAttribution: David Lesieur commented@faqing: It might be a good idea to request any missing feature to the Menu Block project. I suspect that the maintainer will be keen on adding them. Menu Block is in a good position to supersede Menu Trim and many similar modules, and it is a good thing for everyone to join forces rather than maintaining a bunch of similar modules.
Comment #20
faqing CreditAttribution: faqing commentedThanks anyway. I think I have no choice and go to use menu block.
Comment #21
David Lesieur CreditAttribution: David Lesieur commentedUntil a final decision is made and announced on the project's page, let's keep this issue open for others to see.
Comment #22
recklessguy CreditAttribution: recklessguy commentedIs there any module that work or serve the functionality of menu trim module?? or is there any alternative module of menu trim?
Comment #23
David Lesieur CreditAttribution: David Lesieur commentedMenu Block is an excellent replacement.
Comment #24
faqing CreditAttribution: faqing commentedI have updated all sites to D6 and replaced Menu Trim with Menu Block. For D6, use Menu Block!
Comment #25
faqing CreditAttribution: faqing commentedWe just use Menu Block module!