Hi,
Without option: Auto Expand Menu Item Sets the expand setting to TRUE only the top hierachy terms are shown.
See: www.aanbiedingen-vakanties.nl second block on the left.
When I use Auto Expand Menu Item Sets the expand setting to TRUE the whole taxonomy tree is shown.
See attached picture.

So the bug only occurs when Auto Expand Menu Item Sets the expand setting to TRUE is NOT selected.
Thanks for going into this!
Greetings,
Martijn

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

indytechcook’s picture

I saw this issue also. I think I may have accidentally fixed it when I was fixing another issue. Please download the dev dated after this post and let me know.

Thanks,
Neil

Summit’s picture

No dev yet later than 2-april. Will do Neil. Thanks for the update.

EDIT: On dev (6.x-2.x-dev (2009-Apr-09) it is not working, sorry..

greetings,
Martijn

Summit’s picture

Hi Neal,
Taxonomy Menu 6.x-2.x-dev (2009-Apr-16) also not working yet.
I only see the top-terms if I do NOT auto expand.
Sorry to have to report this. Greetings, Martijn

ksc’s picture

I have the same problem with latest dev version.
The problem only appears with Menu Path: Hierarchy, Custom Path seems to be ok.

When "autoexpand" option is disabled only vocabulary will be shown (item for vocabulary enabled) and first term level expands when clicking on vocabulary. Other deeper levels are not shown.

indytechcook’s picture

Ok. I'll retest with the Hierarchy path.

indytechcook’s picture

I was also able to reproduce this in version 2.3. When is the last time that the hierarchy path worked correctly?

Summit’s picture

I haven't seen it working correctly for over a month now, do not know when the error started.
Hopefully you find the cure :)
Greetings,
Martijn

ksc’s picture

There is an interesting behaviour that I can see also with "Menu Path: Custom".

Mmh - how can I explane it..

Settings in TM: "Menu Path: Custom" / "Display Depth in Custom Path: 1" so two arguments get passed to the view.

1) When I use for VIEWS page "path = category/%" (just one %) I get two different results:
1a) "Auto Expand" is enabled: Whole menu shows up
1b) "Auto Expand" is disable: Only vocabulary item shows up (or first hierarchy level when "item for vocabulary= disabled)

2) VIEWS page path = category/%/% (two %)
2a) With this path the menu shows up correctly no matter if "Auto Expand" is enabled or disabled.

Considering this behaviour the path for "Menu Path: Hierarchy" should be category/%/%/%/% (VID/TID/TID/TID) when having three hierarchy levels.

The following is happening:

3a) path = category/% / Auto Expand" is enabled: Whole menu shows up
3b) path = category/% / Auto Expand" is disabled: Only vocabulary and first level of terms show up (not expanded)
3c) path = category/%/%/%/% / Auto Expand" is enabled: only 3rd level
3d) path = category/%/%/%/% / Auto Expand" is disabled: only 3rd level (same as 2c)

So why this different behaviour?
For 2a) Both arguments are always there, so category/%/% fits for all cases.
For 3c+d) The number of arguments is only true for the third level of terms.

When directly typing an URL adress with category/vid/tid (like downloads/10/184) or category/vid/tid/tid it works fine with path=category/%. So this seems to be the right thing looking from VIEWS side.

I think the described problem has to do with menu_callback_for_free_hook_into_sth [:-)] and its ability to find an excisting path.

(I´m not sure if it gets clearer now after this whole comment)

Klaus
(Neil, how is TM3 doing? I have nearly completed my community side, without a single line of PHP programming myself - thanks to Drupal Community - I could realize much more than I expected in the beginning - most time I spent with checking modules - just the frontpage needs some more designing -
I´m experimenting with ddblocks to give it some touch of aliveness.)

Martijn, do you use VIEWS for your Hierarchy Path or how do you realize it?

Summit’s picture

Hi,
As explained by Neil, I use a view with argument to get the Hierarchy Path. But it only shows the first depth of terms the last month.
Greetings, Martijn

ksc’s picture

Martijn, how many arguments you are using withing withing the view? What path?

Summit’s picture

Hi, Here is my view explained: http://drupal.org/node/402888#comment-1373796
Greetings, Martijn

indytechcook’s picture

I spend time time doing some debugging in the different situation above. What I could see, the data is being stored in same way in the menu_links table. All taxonomy menu does is save data to that table using the menu_link_save function. It does have something to do with how Drupal displays the menu but I'm not sure where yet. I haven't dug through the core menu code or searched through current bugs.

In Martijn's situation, the URL is changing but what is sent and processed by Drupal is still cateogry/vid/tid/tid and therefore the same way as any other view. I thought you had this working at one time? What happened?

Summit’s picture

Hi Neal,

Yes after thorough investigation I think it was still working on the downloaded .dev version of April 9th, but after this date somehow only the top-terms are shown using the hierarchical Menu Path type. The latest version somehow also not has the view which to choose from anymore?
I thought may be the Custom Path may be needs this one from the latest code, but enabling this type didn't gave back view-selection choose within taxonomy sceen?

Greetings,
Martijn

Summit’s picture

FileSize
46.71 KB

Hi Neal, I attach a screenshot of a working version of hierarchy 9the April version. As you can see, there is the view to choose from.
In the latest .dev version (16 April). The Name of View option is not there anymore..
May be this has to do with this issue?

As you can see on this site: http://www.kies-een.nl/ , it is not working anymore, only the top-terms are shown.

greetings,
Martijn

indytechcook’s picture

That's strange. I don't remember ever having that feature in v2. I'll look back through my versions and see what changes have been made.

Summit’s picture

Hi Neal,
It was in that version necessary to have a view to get the hierarchical option if I remember correct. If that is not needed anymore, ok, but how then proceed?

I can send you in winzip the working 9th april version I have, if you want that?

Greetings, Martijn

indytechcook’s picture

Go ahead and send it. Was that the custom module I put together for you?

Summit’s picture

Ok, I do not know if it was part of the custom module or integrated, I send what I have in the 9th april version. As you know, Drupal is hobby, not my daytime job. I try to send it tonight. Thanks for investigating further!

EDIT: Hi Neil, with disabling the custom module, the view field is gone, but the hierarchy is still working.
Send you through Linkedin a mail. Don't have you're email anymore..sorry. Please reply with correct email.

Greetings, Martijn

indytechcook’s picture

Got it Martijn, I'm looking at it now.

indytechcook’s picture

Well, the version you sent me is the same as the dev. Shoot, I thought we were close. What version of Drupal Core are you running? Did it change? I know i updated to 6.1. I was going to go back and see if it's a difference.

Summit’s picture

Hi Neal, 6.11. may be others in this thread can contribute also.
In holland it is Queensday today. So I am off having a drink and joint!!

EDIT: Queensday became a disaster because a grazy guy hit a car into the audience where the queen would pass..

Did you find a solution please for this auto-expanding?

greetings, Martijn

Summit’s picture

Hi Neal,
Using the latest 6.2-dev from 31 may, using menu-path-type "hierarchy", not-autoexpanded is still not working.
With the nodes, the menu will not expand to the right terms.
See: http://www.kies-een.nl/europa/nederland/noord-holland/amstelveen

The menu to the right should expand to

-Europa
---Nederland
-----Noord-holland
----------Amstelveen

See picture that noord-holland, amstelveen is indeed the hierarchy

Thanks for still going into this and greetings,
Martijn

Summit’s picture

Hi may be somehow related to http://drupal.org/node/317753
thanks for going into this again!
greetings, Martijn

Summit’s picture

Could it have to do with this peace of code I use in settings.php, to get hierarchical templates?

function custom_url_rewrite_outbound(&$path, &$options, $original_path) {
   //The vocabulary which needs url_rewrite with taxonomy_menu enabled
   $vid = 2;
     // Get ID's: [VID]/[TID]/[TID]etc.. out of taxonomy_menu and place them in $matches ARRAY
    if (preg_match('|^category(/.*)|', $path, $matches)) {

      //If the $vid matches the [VID] within the taxonomy_menu ARRAY then url rewrite
       if ($matches[1] = $vid) {
           $ids = explode("/", $path);
    
           if (is_numeric($ids[5])) {
             $term = taxonomy_get_term($ids[5]);
             $path = "plaats/". $term->name."/";
           }
           if (is_numeric($ids[4])) {
             $term = taxonomy_get_term($ids[4]);
             $path = "provincie/". $term->name."/";
           }
           elseif (is_numeric($ids[3]))  {
             $term = taxonomy_get_term($ids[3]);
             $path = "land/". $term->name."/";
           }
           elseif (is_numeric($ids[2]))  {
             $term = taxonomy_get_term($ids[2]);
             $path = "continent/". $term->name."/";
           }   
           elseif ($path <> '') {
               $path = 'regionaal';
           }
            $options['base_url'] = 'http://www.kies-een.nl';
            $options['absolute'] = true;
       }
    }   
}
Scientifik’s picture

Is this issue still active was there a solution?

indytechcook’s picture

this is still an issue. last tie mi was debugging it i got hit by the menu module. I need to look into this again. It's surprises me with 7K installs that people haven't complained more.

southweb’s picture

I wasted a day playing with this module today. If used a custom path for my own MENU_HOOK - i.e. a defined in hook_menu, then top level menu never expands. I assume this because it requires a view.

Ended up using the hooks to generate my own menu based on the MENU_HOOK already created ('products').


function xxxx_taxonomy_menu_delete(&$item) {
     $term =  taxonomy_get_term($item['tid']);
     if ($term->vid != 1) // product category
       return;
     $name = preg_replace("/ /i","-",$term->name);
     $path = "gallery/" . $name;
     menu_link_delete(null,$path);
    return;
}

function xxxx_taxonomy_menu_insert(&$item) {

  if ($item['tid'] == 0){
      $item['remove'] = true;
      return;
  }
 
     $term =  taxonomy_get_term($item['tid']);
     if ($term->vid != 1) // product category
       return;

     $plid = _get_mlid('products');
     $item['plid'] =  $plid;
     $desc = $term->description;
     trim($desc);
     $desc = (strlen($desc) >0)? $desc : $term->name;
     $path = "gallery/" . preg_replace("/ /i","-",$term->name);
     $menu = array("link_path" => $path,
                   "link_title" => $desc,
                   "menu_name" => "navigation",
                   "router_path" => "gallery",
                   "weight" => $term->weight,
                   "plid" => $plid                 
                   );
  
     $result =menu_link_delete(null,$path);
     $result =menu_link_save($menu);
     $item['remove'] = true;
}

indytechcook’s picture

Priority: Normal » Critical

Hello bluffit, I'm glad you got it working. That is a very creative workaround.

When I have extra time, this is my number one priority for this module.

indytechcook’s picture

I"m working on this and issue #514640: Duplication of terms on and off for the next few hours. I'll be on IRC if anyone wants to assist. indytechcook

indytechcook’s picture

After hours of debugging and research, it seems these are linked to issues with the core menu system.

#550254: Menu links are sometimes not properly re-parented
#149562: Menu module causes duplicate menu items
#566094: menu_tree_data() doesn't build proper hierarchy

Some of the times say they are for D7 but also apply for D6. I haven't tested any of the patches yet.

southweb’s picture

Hi

From what I saw of your code, it seems that you needed to be able to allow a router path for custom module functions (not just views). If this was done, and the parent able to be specified properly, it should work.

As you can see from the code above, I can generate the correct menus from the available data ...?

indytechcook’s picture

Thanks for the suggestion bluffit. The router path 'taxonomy/term/%' does exist for the menu links. If it didn't , then none of the menu items would show for the path type. The issue is reproducible using the default path type also.

All of the data is stored correctly in the menu_links table. I've done several comparisons to workflows that work and others that don't. Even after rebuilding the menu, the rows in the menu_links table are correct. If the router path didn't exist, then the row would have been deleted.

I've debugged where the issue is at. The menu tree variable isn't been created correctly in the menu_tree_data/_menu_tree_data function in menu.inc of core. I've narrowed down the issue to those function, I just haven't had an opportunity to debug any farther.

The function _menu_find_router_path would find the correct router path, but this is already called from menu_link_save.

The issue is very easy to reproduce. Just select "use 'all' at the end of the url' You don't even have to use taxonomy_menu. I had issues adding taxonomy/term//all via a menu link manually on admin/build/menu. I know the router item exists because you can go to the page and it returns data (with or without the view enabled). They both use the same router path so I'm not sure why they both wouldn't work.

Don't get me wrong, I would love for that solution to work, I just don't think it will.

joachim’s picture

I found this issue when I was trying to get all the taxonomy terms to link to a single view with TermID argument.

The problem was fixed with this: http://drupal.org/node/292584#comment-1240468 -- adding a placeholder in the view's page display's path setting for the Term ID argument means that core menu system recognizes it as a path and expands the menu correctly.

Summit’s picture

Hi Joachim, I think that was an old issue, as explained on that page. It doesn't solve the current issue.

EDIT: I solved my situation using taxonomy_menu AND Taxonomy_context.
Taxonomy_menu builds the right menu, not autoexpanded in the menu I prefer.
Taxonomy_context vocabulary block shows the menu-item and expands only the active item and children!

EDIT_NEW: Not solved. I use the hierarchical way of looking at the terms, so category/VID/TID/TID/TID etc..
Taxonomy_context buidl correctly the block, but it doesn't work with category/VID/TID/TID, it works with taxonomy/term/TID which is not ok in mine situation.
See: http://drupal.org/node/685502#comment-2881830 for correct place for discussion further I think.

greetings, Martijn

Summit’s picture

Title: Hierarchical menu, NOT auto expaning not working ok » [SOLVED] Hierarchical menu, NOT auto expaning working using taxonomy_menu_trails
Priority: Critical » Normal
Status: Active » Fixed

Hi,
I was tipped about: http://drupal.org/project/taxonomy_menu_trails
This module filled the gap for this feature!
May be possibility to make it a submodule for taxonomy_menu?

greetings,
Martijn

Status: Fixed » Closed (fixed)

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

Summit’s picture

Title: [SOLVED] Hierarchical menu, NOT auto expaning working using taxonomy_menu_trails » [NOT SOLVED] Hierarchical menu, NOT expaning to current term
Status: Closed (fixed) » Active

Hi,
Set this to active again. This is not solved with the latest versions of taxonomy_menu and taxonomy_menu_trails using the hierarchical taxonomy_menu possibility.

Greetings, Martijn

Summit’s picture

Hi,

Still not solved using latest .dev, taxonomy_menu_trails, hierarchical taxonomy menu.
greetings, Martijn

splash112’s picture

Sunscribe, same problem here...

ykyuen’s picture

FileSize
19.35 KB

Hi all,

i got the same problem. i have taxonomy menu installed but it never expands after clicking it. so i installed the taxonomy_menu_trails as suggested but i still cannot make it work. here are my modules versions

  • Taxonomy Menu 6.x-2.9
  • Taxonomy Menu Trails 6.x-1.1

i have enabled

  • Taxonomy Menu
  • Taxonomy Menu Custom Path
  • Taxonomy Menu Hierarchy
  • Taxonomy Menu Trails

then i set the Taxonomy Menu Trails configuration as attached.... but still the menu doesn't expand and only the first level of taxonomy is shown.

Thanks,

ykyuen’s picture

I find that the problem maybe caused by my theme_menu_item_link() function in the template.php. sorry for the misleading.

aliciatheduff’s picture

This is a jquery workaround I came up with for now – (using menu block + menu trails + taxonomy menu modules). I set taxonomy menu to "Auto expand menu items" then used jquery to collapse based on active classes.

$(document).ready(function(){
	$(".menu-block-1 > ul > li > a.active, .menu-block-1 > ul > li > a.active-trail").parent().siblings().removeClass("expanded").addClass("collapsed").children("ul").css('display', 'none');
    $(".menu-block-1 a.active").parent().parent().parent().siblings().removeClass("expanded").addClass("collapsed").children("ul").css('display', 'none');  
}) 
knalstaaf’s picture

Priority: Normal » Major

Subscribing.

splash112’s picture

Have some problems with this too....

Somehow my problems go away when I use the Edit term module to set menu items and paths. You can find the module here:
http://drupal.org/project/edit_term

Not a very easy path though, it creates quite a lot of problems on the way and which can be resolved by adding the path manually, making sure the menu settings are correct and rebuilding the menu quite some times. I use 1 vocabulary with "Per language terms".

You can see the result here:
www.dinilu.nl
www.dinilu.eu

pineray’s picture

Perhaps this issue is from same reason of the issue below.

Custom menus never receive an active trail
http://drupal.org/node/942782

binford2k’s picture

@PineRay, yes, I just came to post that resolution. I simply stuck the tax menu under Navigation and all was happy.

dstol’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

The Drupal 6 version is no longer supported