Does Menu Block integrate with the jquery menu module like it does with DHTML Menu Module?

The reason I ask is because DHTML Menu Module Menus seem so unnatural to navigate. I'm referring to the part where you have to double click on the menu item.

Thank you for such a great module.

CommentFileSizeAuthor
#7 jqmenu-integration.patch1010 bytesyesterday
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Category: support » feature
Status: Active » Closed (won't fix)

No, Menu Block actually heads to be included into Drupal core. If you want such functionality, a contrib module would have to integrate with Menu Block.

JohnAlbin’s picture

More specifically jquery menu module creates its own blocks. It could be re-written to extend the blocks of menu_block.module, I suppose. But that would be a feature request for them. :-)

But DHTML Menu Module seems like it already does this.

PixelClever’s picture

Category: feature » support
Status: Closed (won't fix) » Postponed (maintainer needs more info)

Hello all, I am the creator of the JQuery menu module. JQuery provides an API for processing a $tree array to create a jquery menu block.

I could create an extension if your module provides the $tree for the menus it creates. Is there a function that calls a menu block $tree that has already been processed according to levels.

I posted the documentation for the JQuery Menu API here. http://pixelclever.com/official-documentation-jquery-menu-api.

davidcgutman’s picture

This would be fantastic! If I have the time/ability I'll see if I can help.

okmi’s picture

we would very much like to see this functionality for the menu block module as well. i agree with gmclelland that dhtml menus - while very nice - are counter-intuitive as far as the drop-down is concerned.

bgilday’s picture

I would just like to chime in and re-iterate how powerful a Menu Blocks / Jquery Menu integration would be. I am using Menu Blocks to great effect on my sites, but I do have some clients who are interested in enhancing those context-specific menus with collapsible JQuery menus.

yesterday’s picture

FileSize
1010 bytes

I needed this functionality as well, so I looked into integrating it myself. I thought it would be good to share with others that we interested. This is my first patch submission, and may not be well-formed. Let me know what I need to do differently next time. :)

temp’s picture

please update this patch for latest version. or include in module. i can test it.

PixelClever’s picture

Category: support » feature
Status: Postponed (maintainer needs more info) » Needs work

Though I am not the maintainer of menu blocks, I can tell you that the patch above probably wouldn't ever fly since it makes a direct reference to the jquery menu module. Really the issue is broader than jquery menu, and any patch should be something that separates the menu level processing out to a separate function that returns a modified tree. That way any module can call the menu block version of the $tree array and make use of it.

If there is a function that I could call to modify a tree structure according to a particular menu block then I could call it from within my module, or from any other module for that matter.

I think that it could be argued that opening up the menu blocks module so that the work it does can be accessed before html structuring occurs would have merit in many more cases than the jquery menu module.

I honestly would like to work on this, but currently I have a baby on the way and a house to build before it arrives, so I don't have much free time. I will however commit to implementing the integration from within jquery menu if and when the option exist.

jlea9378’s picture

I'm interested in incorporating this into my drupal installation. However can it be made to work on the current versions of jquery (6.x-3.0) and menu block (6.x-2.2)?

I changed the code to be thus:

  // Render the tree.
  $data['content'] = menu_block_tree_output($tree);

  if ($data['content']) {

    $settings = array(
      'menu_name' => $menu_name,
      'parent_mlid' => $parent_mlid,
      'level' => $level,
      'follow' => $follow,
      'depth' => $depth,
      'expanded' => $expanded,
      'sort' => $sort,
    );

    // jQuery Menu Integration!
    if(module_exists('jquerymenu')) {
      $trail = array();
      $_tree =& $tree;
      while ($_tree) {
	$found = false;
	foreach (array_keys($_tree) as $key) {
	  if ($_tree[$key]['link']['in_active_trail']) {
	    $trail[] = $_tree[$key]['link']['href'];
	    $_tree =& $_tree[$key]['below'];
	    $found = true;
	    break;
	  }
	}
	if(!$found) break;
      }
      $data['content'] = theme('menu_creation_by_array', $tree, $trail);
    } else
    $data['content'] = theme('menu_block_wrapper', $data['content'], $settings);

However I am receiving the following error when viewing the pages:
warning: Invalid argument supplied for foreach() in /var/www/html/drupal_test/sites/all/modules/jquerymenu/jquerymenu.module on line 207.

neorg’s picture

Subscribing

PixelClever’s picture

Title: Jquery Menu Module Integration » Open

For those interested in this, please see the patch posted on http://drupal.org/node/913632
If that patch gets committed then I can add menu block support on Jquery Menu.

PixelClever’s picture

Title: Open » Open menu data up to other modules
Status: Needs work » Closed (duplicate)