I am using trim menu for all my sites. Please consider to update to D6. Many thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DynV’s picture

Assigned: Unassigned » DynV

I will as soon as I have time.

dan_aka_jack’s picture

subscribing...

sam6’s picture

subscribing

Mark Trapp’s picture

Hello, 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?

David Lesieur’s picture

No need to fork... Please submit your patch here for review by the community. Thanks!

Mark Trapp’s picture

Component: Miscellaneous » Code
Status: Active » Needs review
FileSize
497 bytes
9.62 KB

Patch 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.

David Lesieur’s picture

Assigned: DynV » Unassigned
Status: Needs review » Needs work

The 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'):

        if (menu_get_active_menu_name() == $delta) 

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.

David Lesieur’s picture

Title: Please consider to update for D6 » Port to Drupal 6
Mark Trapp’s picture

Ah, 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.

Mark Trapp’s picture

Status: Needs work » Needs review
FileSize
9.82 KB

New 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.

mlieshout’s picture

Any news on this module? The latests patch doesn't seem to work for me (drupal 6.8 install).

David Lesieur’s picture

@mlieshout: Can you provide more details on what doesn't work? Thanks.

mlieshout’s picture

I 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

mlieshout’s picture

@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.

David Lesieur’s picture

Status: Needs review » Needs work

Thanks for the update!

David Lesieur’s picture

Well, apparently the Menu Block module now seems to support most (if not all) of what Menu Trim used to provide. Its project page states:

As you traverse down the menu, more and more of the menu is trimmed from the block. Menu block 6.x-2.1 or later contains this functionality.

This is great news. Can anyone report success with this feature in Menu Block?

mlieshout’s picture

Menu 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:

  • Menu: Primary links
  • Item:
  • Starting level: 1st level (primary)
  • Maximum depth: 1

Second one for the second level menus:

  • Menu: Primary links
  • Item:
  • Starting level: 2nd level (secondary)
  • Maximum depth: 1

And activate the blocks.

I haven't tried this with more than 2 levels but it should be no problem.

faqing’s picture

Menu 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!!!

David Lesieur’s picture

@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.

faqing’s picture

Status: Needs work » Closed (fixed)

Thanks anyway. I think I have no choice and go to use menu block.

David Lesieur’s picture

Status: Closed (fixed) » Active

Until a final decision is made and announced on the project's page, let's keep this issue open for others to see.

recklessguy’s picture

Is there any module that work or serve the functionality of menu trim module?? or is there any alternative module of menu trim?

David Lesieur’s picture

Menu Block is an excellent replacement.

faqing’s picture

I have updated all sites to D6 and replaced Menu Trim with Menu Block. For D6, use Menu Block!

faqing’s picture

Status: Active » Closed (fixed)

We just use Menu Block module!