I just installed and tested jquery menu, and I like it lot.

My only problem is that it does not automatically expand the parent menu item(s) for page you are visiting.

It sure would be nice if it could do this - but I cannot seem to be able to figure out a way just using CSS.

Maybe, this could be a future feature request -OR- if someone has a patch or suggested method for adding this functionality.

I do know a bit of PHP, but I am not a hard-core coder.

CommentFileSizeAuthor
#60 2.png1.44 KBabarpetia
#60 1.png3.29 KBabarpetia
#18 openblock.png23.68 KBPixelClever

Comments

jondblackburn’s picture

Category: feature » bug

Looking through the code for the module (to see if it was themable) . . . I see that apparently, this functionality is supposed to be here already


// If the menu item is expanded or in the active trail and if has children add the "open" class.
    if (!empty($item['link']['expanded']) || (in_array($item['link']['link_path'], $url_array) && !empty($item['link']['has_children']))){
      $classes[] = 'open';
      $state = 'open';
    }

So, I am changing this to a bug report - though there is obviously the possibility that I am doing something wrong.

More Explanation - added 12/10/08

P.S. Please let me know if I am understanding the code above incorrectly, but it seems like any menu item(s) in the "active trail" should be open/expanded by default.

E.G. If you have ...

Menu Item 1
- SubMenuItem 1
- Page 1
- Page 2

And you are on Page 2

Then, Menu Item 1 and SubMenuItem1 should both have the "open" class - expanding both options when on that page.

Is this correct?

PixelClever’s picture

Category: bug » support
Priority: Normal » Minor
Status: Active » Postponed (maintainer needs more info)

Where is the block you are using? Did you put in the primary links section? Some themes remove the active trail and menus placed in the primary links section almost always have them removed. Go to http://www.pixelclever.com/drupal-theme-conversion-psd-or-fireworks-files and look how the menu responds to the active trail. I use this module on at least 5 themes on separate host without the issue you mentioned, so until I see evidence to the contrary I consider this a theme issue.

Rob T’s picture

I'm experiencing the same issue, no matter what theme I use. My main theme is based on Basic, but all the core Drupal 6.x themes yield the same result. My menu is a custom one. Many of the links point to spots that are views-like (versus actual nodes), so I am unsure if that has anything to do with anything.

In my custom menu-jquerymenu block, I'm not getting my menu's "li" tagged w/ "active-trail". Only the current page's "a" tag gets an "active".

In my primary links area, "active-trail" tagging seems to work fine.

UPDATE: When I use the jquerymenu block for a primary links block, it works as advertised, but only to a depth of 1. Further tiers still yield the closed parents.

Any suggestions or advice?

PixelClever’s picture

Could you show me a link to a page that is having this happen so that I can take a look at the classes that are in place? Try it out on a standard theme such as Garland and tell me if it shows up still. If it does then there is something else besides a theming issue coming up. The module makes use of the active trail that is handed to it by the Drupal system on a per page basis, so if the active trail isn't there then there isn't much my module can do about it. Usually though this kind of thing is related to theme functions that override classes or strip them from the menu before displaying.

Really I can't do anything unless I see an example of this error in action since it is not happening on any of my sites.

yhancik’s picture

I don't have any online example for now, but here's what I get with Garland, on a custom menu :

<ul class="menu jquerymenu" id="jquerymenu-">
<li class="parent closed"><span class="parent closed"></span><a href="/_work/yhnck/?q=node/5">Title1</a>
<ul><li class="active-trail"><a href="/_work/yhnck/?q=node/6" class="active">Item1</a></li></ul></li></ul>

clicking on Item1 closes the Title1 level

VS the administrative menu

<ul class="menu jquerymenu" id="jquerymenu-">
<li><a href="/_work/yhnck/?q=blog/1">My blog</a></li>
<li><a href="/_work/yhnck/?q=user/1">My account</a></li>
<li class="parent open active-trail"><span class="parent open active-trail"></span><a href="/_work/yhnck/?q=node/add">Create content</a>
<ul><li class="active-trail"><a href="/_work/yhnck/?q=node/add/blog" title="" class="active">Blog entry</a></li><li><a href="/_work/yhnck/?q=node/add/book" title="">Book page</a></li>
(...)

--

edit

Obviously, menu_get_active_trail() skips the parent node when clicking on a child.

thus, if the (working) administrative menus have this $url_array

array (
0 => '',
1 => 'node/add',
2 => 'node/add/story',
)

the custom menu returns

array (
0 => '',
1 => 'node/6',
)

when it should be

array (
0 => '',
1 => 'node/5',
2 => 'node/6',
)

Now let's figure out why...

Could it be some kind of incompatibility with another module ? (since I'm using Garland, here)

miiimooo’s picture

It's a problem with the activemenu. If the menu you're using isn't drupal's active menu it will set the trail according to the one that is active ('navigation' by default).
For instance if you put this:

function jqmenu_trail_creator() {
	menu_set_active_menu_name("name of your menu that jquery menu wraps around");

then it work correctly.

Is there a better way of doing this though?

miiimooo’s picture

Didn't take long and I found how to do it properly. Here's the code for the function - it only differs on three lines:

function jquerymenu_block($op = 'list', $delta = 0, $edit = array()) {
  $result = db_query("SELECT mid, menu_name FROM {jquerymenus}");
  $enabledmenus = array();
  while ($enabled = db_fetch_object($result)) {
    $enabledmenus[] = $enabled->menu_name;
  }
  switch ($op) {
    case 'list':
      $x = 0;
      foreach ($enabledmenus as $name) {
        $title = db_result(db_query("SELECT title FROM {menu_custom} WHERE menu_name = '%s'", $name));
        $blocks[$x]['info'] = $title .' - Jquerymenu';
        $blocks[$x]['cache'] = BLOCK_NO_CACHE;
        $x++;
      }
    return $blocks;

    case 'view':
      $d = 0;
      global $user;
//       $trail = jqmenu_trail_creator();
	  $old_activemenu = menu_get_active_menu_name();
      foreach ($enabledmenus as $menuname) {
        if ($delta == $d) {
          if ($menuname == 'navigation' && !empty($user->uid)) {
            $title = $user->name;
          }
          else {
            $title = db_result(db_query("SELECT title FROM {menu_custom} WHERE menu_name = '%s'", $menuname));
          }
		  menu_set_active_menu_name($menuname);
		  $trail = jqmenu_trail_creator();
          $block['subject'] = $title;
          $menutree = menu_tree_all_data($menuname);
          $block['content'] = theme('menu_creation_by_array', $menutree, $trail, $menuname);

        }
        $d++;
      }
	  menu_set_active_menu_name($old_activemenu);
  }
  //end switch ($op)
  return $block;
}
krisrobinson’s picture

That worked for me. Thanks.

PixelClever’s picture

I think there is a module compatibility issue going on here. Some other module or theme function is overriding the active trail. Perhaps this is a reasonable safeguard to insure that it doesn't happen, however I think it would be good to know why this is happening only on a few installations before committing it.

PixelClever’s picture

Status: Postponed (maintainer needs more info) » Patch (to be ported)
PixelClever’s picture

Status: Patch (to be ported) » Fixed

Committed in 2.1.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

drupalninja99’s picture

Version: 6.x-1.5 » 6.x-2.3
Status: Closed (fixed) » Needs review

The problem with this fix above is that I don't think it works with menus that go deeper than just 1 level. If the jquery menu goes a couple menus deep what happens is that the inner most menu has the class "open" but the parent menus have the class "closed" and so what results is that the menu is closed, which looks like a bug.

Possible fix: I modified recursive_link_creator() in v 6.x-2.3, line 189 to add another condition to look up the $item['link']['href'] in the $url_array using a regular expression to see if $item['link']['href'] is in the same path, if so it makes it open as well. This might not be the cleanest solution, maybe someone else can clean it up, but my initial tests look like it works. If it does, will someone please make a patch and commit? Thanks! -J

// If the menu item is expanded or in the active trail and if has children add the "open" class.
    if (!empty($item['link']['expanded']) || ((in_array($item['link']['href'], $url_array) || ($_GET['q'] == $item['link']['href'])) && !empty($item['link']['has_children']) && !empty($nextlevel))) {
      $classes[] = 'open';
      $state = 'open';
    }////// BEGIN NEW CHANGE ///////////////////
    else {
    	/**
    	 * Go through each url and see if the current url is in the path (meaning it's a parent, if so make it open as well)
    	 */
    	foreach ($url_array as $url) {
    		$needle = str_replace('/', '\/', $item['link']['href']);
    		
    		if (preg_match("/^$needle/", $url)) {
				$classes[] = 'open';
      			$state = 'open';
      			break;    			
    		}
    	}
    	
    	if ($state != 'open' && !empty($item['below']) && !empty($nextlevel)) {
	      $classes[] = 'closed';
	    }
    }/////// END NEW CHANGE /////////////////
duckzland’s picture

// If the menu item is expanded or in the active trail and if has children add the "open" class.
    if (!empty($item['link']['expanded']) || ((in_array($item['link']['href'], $url_array) || ($_GET['q'] == $item['link']['href'])) && !empty($item['link']['has_children']) && !empty($nextlevel))) {
      $classes[] = 'open';
      $state = 'open';
    }////// BEGIN NEW CHANGE ///////////////////
    else {
    /**
    * Go through each url and see if the current url is in the path (meaning it's a parent, if so make it open as well)
    */
    foreach ($url_array as $url) {
    $needle = str_replace('/', '\/', $item['link']['href']);
   
    if (preg_match("/^$needle/", $url)) {
$classes[] = 'open';
      $state = 'open';
      break;   
    }
    }
   
    if ($state != 'open' && !empty($item['below']) && !empty($nextlevel)) {
      $classes[] = 'closed';
    }
    }/////// END NEW CHANGE /////////////////

not working in acquia marina.

PixelClever’s picture

Status: Needs review » Closed (fixed)

I spent some time with someone who was having this problem and it went away when they upgraded to version 3.0 of the module. There have been many changes made in the 3.0 version. I am going to close this issue for now, if it shows up in the 3.0 then reopen it as a 3.0 bug and I will investigate.

ashiwebi’s picture

Priority: Minor » Critical
Status: Closed (fixed) » Active

It works on node/nid but we need support on show/nid.

If you have any suggestion on this please respond as soon as possible

adam_b’s picture

Version: 6.x-2.3 » 6.x-3.2

Subscribe - I'm still having this problem with v6.x-3.2. As pointed out in #13, it works for the first level but not for any level below that. I'm using the Basic template with a few CSS-only changes.

PixelClever’s picture

StatusFileSize
new23.68 KB

I tested this on my site at admin/build/menu-customize/navigation which is several levels deep and it opened automatically as would be expected. I am attaching a screen shot to show it. I am not against fixing this bug, the problem is that I don't have the conditions on my installations which are causing it to appear. That being the case, I either need a very precise description of the steps required to reproduce this behavior on a fresh install, or I need a patch to be submitted against the current version that doesn't affect the rest of the module.

digitalfrontiersmedia’s picture

I wrote this modification to recursive_link_creator about a year ago. It was kind of kludgy then and still is now, but always seems to work for me. I haven't had time to go through and make it more elegant and develop it into a real patch, but I keep coming back to it when using jQuery Menus with Taxonomy Menu:

<?php
function recursive_link_creator($items = array(), $trail) {
  $url_array = $trail;

	//*****  NEW *****//	
	global $active;
	foreach ($items as $item) {
	  if(in_array($item['link']['href'], $url_array)) {
		  for($i=1; $i<10; $i++) {
			  if($item['link']['p'.$i] != 0) { //if item is active tail, get a list of it's parents.
				  $active  .= ' ' . $item['link']['p' . $i];
			  }
			}
		}
	}
	//***** END NEW *****//

  $i = 0;
  if (!empty($items)) {
    foreach ($items as $item) {
      $classes = array();
      $state = 'closed';
      // If there are submenu items we assign the parent a class.
      if (!empty($item['link']['has_children'])) {
        $nextlevel = '';
        $nextlevel = recursive_link_creator($item['below'],$url_array);
        if (!empty($nextlevel)) {
          $classes[] = 'parent';
        }
      }
      
      //***** ALTERED *****//
      // If the menu item is expanded or in the active trail and if has children add the "open" class.
    if (strpos($active, $item['link']['mlid'])!=0 || strpos($active, $item['link']['mlid'])!='' || !empty($item['link']['expanded']) || ((in_array($item['link']['href'], $url_array) || ($_GET['q'] == $item['link']['href'])) && !empty($item['link']['has_children']) && !empty($nextlevel))) {
     //*****  END ALTERED *****//

        $classes[] = 'open';
        $state = 'open';
      }
      elseif (!empty($item['below']) && !empty($nextlevel)) {
        $classes[] = 'closed';
      }
?>

Basic idea is to get a list of parents for the active menu item prior to setting menus to "open", then just modify the conditional making that determination, using it to set all parents to "open" as well.

digitalfrontiersmedia’s picture

Hi Aaron,

In my experiences, the problem has always shown itself when using JQuery Menu with a Taxonomy Menu module-created menu when the default (or modified) taxonomy_term view is enabled (i.e., not using Drupal's standard taxonomy page handler but the one from Views).

And I think that maybe it's using taxonomy_term that for some reason winds up killing your module's ability to open the items in the active trail, because your module WAS working for me as expected initially, then I found it wasn't after adding that for my results page.

EDIT: Just confirmed this by disabling the taxonomy_term View and reverting back to your core code. If NOT using taxonomy_term View, then your code works. Otherwise, I need to apply my custom modification to get your code to work.

TimG1’s picture

Hi Everyone,

For me this is working as expected when using the Blocks that are generated in admin/build/block.

However, when trying to use this via the API the parent item is not "open" when on a child page of that parent.

Maybe I'm using this wrong but here is what I'm doing....

  // Taken from http://pixelclever.com/official-documentation-jquery-menu-api

  $menutree = menu_tree_all_data(menu_get_active_menu_name());
  $trail = menu_get_active_trail();

  print theme('menu_creation_by_array', $menutree, $trail);

Thanks for reading,
-Tim

grego3781’s picture

Greetings,

I'm trying to utilize the API to display the a subsection of the
menu.

For example:

Cars
-Foreign
--Porsche
--Mercedes
--Lexus
-Domestic
--Ford
--Chevy
--Chrysler
Food
-Fruits
--Apples
--Oranges
--Grapes
-Vegetables
--Tomatoes
--Carrots
--Peas

When I'm on the "Oranges" page, I want to display the following jQuery Menu:

Food
-Fruits
--Apples
--Oranges
--Grapes
-Vegetables

With the "Fruits" menu expanded and the "Vegetables" menu with a '+' sign with the option to expand

When I'm on the "Porsche" page, I want to display the following jQuery Menu:

Cars
-Foreign
--Porsche
--Mercedes
--Lexus
-Domestic

With the "Foreign" menu expanded and the "Domestic" menu with a '+' sign with the option to expand.

Any direction is greatly appreciated.

Thanks

kdhartstrom’s picture

Having item expanded to the active menu menu item more then 1 level deep also seems to break with the admin 2.x module http://drupal.org/project/admin enabled and active.

oddhenrik’s picture

Hi, I'm a Drupal and PHP newbie and this is my first post, so be gentle with me ; )

I had the exact problem as this issue, menu items would not keep open as you have described. So i applied DigitalFrontier's modifications. This seemed to work just great. But I have two menu block's and found that occasionally a menu item in the other block would open when I opened one in the other.

After a bit of debugging I found that there where mlid's such as 1234 and 34 and the check:

strpos($active, $item['link']['mlid'])!=0

Would return true for both in such cases. I checked the PHP manual and altered the code to be:

//**** Original code by DigitalFrontier ****//
//if (strpos($active, $item['link']['mlid'])!=0 || strpos($active, $item['link']['mlid'])!='' || !empty($item['link']['expanded']) || ((in_array($item['link']['href'], $url_array) || ($_GET['q'] == $item['link']['href'])) && !empty($item['link']['has_children']) && !empty($nextlevel))) {

//**** ALTERED CODE ****//
if (in_array($item['link']['mlid'], explode(" ", $active)) || !empty($item['link']['expanded']) || ((in_array($item['link']['href'], $url_array) || ($_GET['q'] == $item['link']['href'])) && !empty($item['link']['has_children']) && !empty($nextlevel))) {

This seems to solve the problem. This is about the first line of PHP I have written. So any comments on the solution is welcome.

oddhenrik’s picture

Site off-line issue made me post triple, sorry....

oddhenrik’s picture

Site off-line issue made me post triple, sorry....

rilsonraposo’s picture

Hi,

I solved it making a change on javascript. At jquerymenu_no_animation.js, add the folowing line:

Drupal.behaviors.jquerymenu = function(context) {
/* add the following line */
$('ul.jquerymenu .active').parents('li').removeClass('closed').addClass('open');
/* end adding */

 $('ul.jquerymenu:not(.jquerymenu-processed)', context).addClass('jquerymenu-processed').each(function(){

If using animations, add the line to jquerymenu.js, as showed bellow:

Drupal.behaviors.jquerymenu = function(context) {
/* add the following line */
$('ul.jquerymenu .active').parents('li').removeClass('closed').addClass('open');
/* end adding */

 $('ul.jquerymenu:not(.jquerymenu-processed)', context).addClass('jquerymenu-processed').each(function(){

The added code just finds all <li> tags that are parents of the active <li> tag and opens them.

I hope it helps!

digitalfrontiersmedia’s picture

I like the jQuery quick fix, but I think the source code coming out of Drupal is the original source of the error and that's where the fix should truly be applied. But so long as these options don't get committed, I guess whatever works, eh?

anybody’s picture

Truly needed patch... please fix and release it asap.

nubeli’s picture

I can confirm that the jquery additions in #27 do the trick.

yochee’s picture

still not working for my page. i experience the issue on book-pages. i am using the nitobe theme.

problem 1:
in a menu with normal pages and book-pages (with a real menu path) the book-pages dont open the menu-path as it should. on the normal pages the module just works as it should. (but isnt a book page a normal node but with a more komplex and separete back and forth menu?)

problem 2:
there are some book-pages that dont have a menu path in the main menu, because the are included in a book menu. but i told these book-pages, under which menu point they are.. doesnt work either

Site structure:

main ------------- (normal node, in menu)
-sub1 ------------ (normal node, in menu)
--sub2 ----------- (normal node, in menu)
--sub2 ----------- (normal node, in menu)
--book1 --------- (book page, in menu)
---book2 -------- (book page, in menu)
----book3 ------- (book page; not in menu because of seperate book menu)
----book3 ------- (book page, not in menu)
----book3 ------- (book page, not in menu)
---book2 -------- (book page, in menu)
----book3 ------- (book page, not in menu)
----book3 ------- (book page, not in menu)
----book3 ------- (book page, not in menu)
---book2 -------- (book page, in menu)
----book3 ------- (book page)
----book3 ------- (book page)
----book3 ------- (book page)
--sub2 ----------- (normal node)
--sub2 ----------- (normal node)

   <li style="display: list-item;"><a href="/node/968" title="4.1.1.7">4.1.1.7 Der siebte Vers</a></li>
   <li style="display: list-item;"><a href="/node/875" title="4.1.1.5">4.1.1.8 Der achte Vers</a></li>
   <li style="display: list-item;" class="active-trail active"><a href="/node/877" title="4.1.1.6">4.1.1.9 Übung: Verse 9-11</a></li> (on this book page the menu is not opened! [corresponds with book1])
   <li style="display: list-item;"><a href="/node/878" title="4.1.1.7">4.1.1.10 Der zwölfte Vers</a></li>
   <li style="display: list-item;"><a href="/node/879" title="4.1.1.8">4.1.1.11 Vers 13</a></li>

maybe this helps for recreating?

arx-e’s picture

#27 fixed the problem for me.
Thank you rilsonraposo!

CarbonPig’s picture

#27 worked for me

http://carbonpig.com

Thanks,

CarbonPig

mesch’s picture

Version: 6.x-3.2 » 6.x-3.3
Component: Miscellaneous » Code
Category: support » feature
Priority: Critical » Minor
Status: Active » Needs work

I can also confirm #27 does the trick w/ version 6.x-3.3. Would definitely like to see this fixed in the next version.

Thanks to rilsonraposo for the hack, and to Aaron and other contributors for a very useful module.

massud’s picture

#27 does the job but it does not change the collapsed icon (+) to expanded (-). The complete solution is:

At jquerymenu_no_animation.js, add the folowing line:

Drupal.behaviors.jquerymenu = function(context) {
/* add the following line */
$('ul.jquerymenu .active').parents('li').removeClass('closed').addClass('open');
$('ul.jquerymenu .active').parents('li').children('span.parent').removeClass('closed').addClass('open');
/* end adding */

$('ul.jquerymenu:not(.jquerymenu-processed)', context).addClass('jquerymenu-processed').each(function(){

If using animations, add the line to jquerymenu.js, as showed bellow:

Drupal.behaviors.jquerymenu = function(context) {
/* add the following line */
$('ul.jquerymenu .active').parents('li').removeClass('closed').addClass('open');
$('ul.jquerymenu .active').parents('li').children('span.parent').removeClass('closed').addClass('open');
/* end adding */

$('ul.jquerymenu:not(.jquerymenu-processed)', context).addClass('jquerymenu-processed').each(function(){
anybody’s picture

Status: Needs work » Needs review

Changed status to needs review. If the patch works without any problems it may walk into the next version?

summit’s picture

Hi,
It would be great to have this also in D7. See http://drupal.org/node/996444#comment-5275708 for D7 port.

Is #35 committed to the module on D6, or something similar may be?

greetings, Martijn

essbee’s picture

#35 works for me.

aa461’s picture

#35 worked ok for me,

Thanks, massud and rilsonraposo.

summit’s picture

Hi, Does #35 also work with core patch enabled? I am referring to: http://drupal.org/node/942782#comment-5330668.
Thanks for your reply in advance!
Greetings, Martijn

summit’s picture

Hi,
Patch in http://drupal.org/node/344916#comment-4621198 expands nicely on termpages, but it will NOT expand on node pages. Sorry..
How can I get jquerymenu with a taxonomy menu custom menu to expand on node pages (panel node override node pages).

I use D6 latest version, Fervens theme, and from jquery the 6.33 version.
Thanks a lot in advance for your reply.

greetings,
Martijn

amysiano4x3’s picture

Martijn-

I am having the same issue with panel node pages. Did you find a solution? I am using this for a product catalog and woul like the menu to remain open on the product.

brst t’s picture

20131102 - removed by author

pat redmond’s picture

Status: Needs review » Postponed (maintainer needs more info)

Will fix in the next version, to be posted shortly. Give that a go, and let me know if the problem persists.

hillaryneaf’s picture

Confirming #35 works for me for node pages... will be good to have it fixed in next version.

pat redmond’s picture

nektir, can you use 6.x-4.0-alpha2 and confirm whether this fixes the error? It should contain the patch so you don't have to change the module at all.

Anonymous’s picture

Version: 6.x-3.3 » 7.x-3.x-dev
Category: feature » bug
Priority: Minor » Normal
Status: Postponed (maintainer needs more info) » Reviewed & tested by the community

Confirming that #35 works.

Only half of the patch got into the 7.x-3.x-dev version. jquerymenu_no_animation.js got patched but not jquerymenu.js.

Changed this to a bug report, with priority to "normal"; arguably should be "major". This can be a significant wtf for end-users.

pat redmond’s picture

Can you double check this for me? Specifically, can you confirm that your jquerymenu.js file at lines 39 and 40, and let me know whether the patch is there?
jquerymenu.js looks significantly different to jquerymenu_no_animation.js - in the D7 version the no_animation version isn't used anymore. Everything happens in the single js file. I will remove the no_animation next time I do an update.

Anonymous’s picture

I've just re-downloaded jquerymenu-7.x-3.x-dev.tar.gz from the project page. In its version of jquerymenu.js, lines 39-40 are:

$('ul.jquerymenu .open').parents('li').removeClass('closed').addClass('open');
$('ul.jquerymenu .open').parents('li').children('span.parent').removeClass('closed').addClass('open');

Note that this applies only to the .open class. The file does not include the needed additional lines:

$('ul.jquerymenu .active').parents('li').removeClass('closed').addClass('open');
$('ul.jquerymenu .active').parents('li').children('span.parent').removeClass('closed').addClass('open');

These apply to the .active class.

pat redmond’s picture

Status: Reviewed & tested by the community » Closed (fixed)

OK, I will make sure this is added to the next dev release.

1mundus’s picture

Version: 7.x-3.x-dev » 7.x-4.0-alpha3
Status: Closed (fixed) » Active

Unfortunately, this feature seems very buggy. It's highlighting only the first term that you open. Here is the example:

- Term 1
--- Term 2
--- Term 3
- Term 4
--- Term 5
--- Term 6

If I land on Term 2, it will display it properly as highlighted and expand Term 1.
However, when I click on Term 5, Term 2 is still the one that is displayed as highlighted and Term 1 is expanded instead of Term 4 being expanded.

Classes used are "parent open" and "leaf open".

The same thing is valid for both term and node pages.

Otherwise the module is great and thank you for your work!

1mundus’s picture

Hm, I have noticed a strange thing - when I'm logged in (administrator), it seems to work properly. As soon as I browse it as an anonymous user, it does what I have described in the previous post. I have cleared all of the caches and tried all of the options on the settings page, but it doesn't change anything.

ranx’s picture

I can confirm #52

Works well when logged in, does not work for anonymous.

jeepster’s picture

Assigned: Unassigned » jeepster

I fixed this problem by changing 2 lines in jquerymenu.module:

if (
        ((!empty($item['link']['mlid']) && (in_array($item['link']['mlid'], $url_array))) || 
        //($item['link']['expanded'] === 1) || 
        ((in_array($item['link']['href'], $url_array) || ($_GET['q'] == $item['link']['href'])) && !empty($item['link']['has_children']) && !empty($nextlevel))
        && ($item['link']['href'] != '<front>'))
        ) {
        --$classes[] = 'open';
        --$state = 'open';
	++$classes[] = 'closed';
        ++$state = 'closed';
      }

With this fix the menu expands only the item menu-parent and not all menu items.

Hope this help

crutch’s picture

in reference to #51

I have some confusion.

7.x-4.0-alpha3

Categories
- {Parent} Term 1
--- {Child} Term 2 = Taxonomy list of nodes
------ Node 1 - contains multiple terms
------ Node 2
------ Etc.
--- {Child} Term 3
- {Parent} Term 4
--- {Child} Term 5
------ Node 1 - contains multiple terms
------ Node 2
------ Etc.
--- {Child} Term 6

  • {Parent} menus are collapsed in menu settings.
  • nodes contain multiple taxonomies (tags) including {Parent} Term 1, {Child} Term 2, {Parent} Term 4, {Child} Term 5

When clicking to Node 1 under {Parent} Term 4, {Parent} Term 1 is always expanded. It seems to select the first parent term to expand no matter how navigating there.

adanielyan’s picture

jeepster, does that solve problem described in #52?

Were anybody able to resolve issue #52?

pat redmond’s picture

Can a few people try this: https://drupal.org/node/1938518
I think mmn has found the issue! I will add it to the next release, which I hope to do in the next couple of days.

adanielyan’s picture

Recently installed 7.x-4.0-alpha3 version on a different site. The issue is gone and it works as expected.

elliot’s picture

Not sure if others are still having this issue, but we are. Here's an example link: https://nook.marlboro.edu/public/offices/it/faq/filestransfer The page should open the Information Technology sub-menu, but doesn't. I've attempted https://drupal.org/node/1938518, but haven't done much other investigation yet.

abarpetia’s picture

Issue summary: View changes
StatusFileSize
new3.29 KB
new1.44 KB

Hello Elliot,
I am also facing the same problem. Did you found solution for this issue?

When i navigate through my menu items (see attachment 1.png) and click on 1.1.1 Template , it's perfectly open my provided link but the menu item get collapsed completely (see attachment 2.png).

I have also applied this patchhttps://drupal.org/node/1938518, but still not working.
Thanks... :)

abarpetia’s picture

Found solution. When i used absolute paths in menu path then menu items get collapsed which is fair enough.