Custom menus outside active path not being loaded

budesigns - June 5, 2009 - 21:17
Project:DHTML Menu
Version:6.x-3.5
Component:Javascript code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Issue tags:show/hide, taxonomy, toggle
Description

Sorry, no idea how to explain that any better... (also, I'm not actually sure the problem has to do with the JavaScript)

Here's what's happening:

I have a nav menu, created via the Taxonomy_menu module, with several levels of taxonomy term menu items, and nodes which are attached to the lowest menu level items.

Looks like this:

Level 1
- Level 2
- Level 2
- - Level 3
- - Level 3
- - Level 3
- - - Node 1 <-- you are here
- - - Node 2
- - - Node 3
- - Level 3
- Level 2
Level 1
Level 1

(Assume all levels are populated with some children and nodes.)
If you begin with all items collapsed, you can navigate to any part of the menu flawlessly. But, if you are starting at a page (see "you are here", above), you can't expand any of the other menu items at the same level as its parent. (In this example, that means you can't expand any of the other Level 3 items.) They will simply load their taxonomy page instead of expanding to reveal the nodes within.

I will attach a screenshot of my menu settings, in case I missed something there.

Thank you.

AttachmentSize
DHTMLmenu.gif15.35 KB

#1

Arancaytar - June 6, 2009 - 10:45
Priority:normal» critical

Did this work in 6.x-3.4 before you upgraded to 6.x-3.5? If so, then #356495: Nice menus compatibility may have introduced a regression.

I'll have to check out how taxonomy_menu works.

#2

Arancaytar - June 6, 2009 - 14:46
Priority:critical» normal
Status:active» postponed (maintainer needs more info)

I could not reproduce this problem. I have attached a screenshot of my taxonomy menu. In it, I am on one term of the vocabulary, and can expand another term of the same vocabulary.

I'm not sure how you got those nodes to show up underneath your terms though; that doesn't work for me.

I'm using the newest version of taxonomy_menu.

#3

Arancaytar - June 6, 2009 - 14:54

I've added the node to the menu by manually creating a menu item and placing it in the term's menu item (see screenshot, "Delicious Pear" is a node in the term "Pear").

While on the node page "Delicious Pear", I can expand the "Apple" menu without a problem, which seems to be the precise issue you reported.

AttachmentSize
dhtml-menu-taxonomy.png 5.42 KB
dhtml-menu-taxonomy2.png 7.93 KB

#4

budesigns - June 6, 2009 - 16:04

I was already having the issue before upgrading to 3.5.
(I don't see your attachment)

Maybe I've got things set up wrong - you mention "not sure how you got those nodes to show up underneath your terms"...?
I used taxonomy & taxonomy-menu to set up my "categories", and create a menu of them. For example, within a vocabulary, I have the following terms/heirarchy:

Food
- Meals
- - Breakfast
- - Lunch
- - Dinner
- Snacks
Drink
Other

Then I created pages (e.g. - a page called "Pancakes"), and under Menu Settings, connected them to their parent category (e.g. - Menu Title: Pancakes, Parent Item: Breakfast), so that these nodes now appear in the menu, as below:

Food
- Meals
- - Breakfast
- - - Pancakes
- - - Bacon
- - - Scrapple
- - Lunch
- - Dinner
- Snacks
Drink
Other

When visiting the Pancakes page, the menu appears, expanded as you see above, with active trail styles applied to the relevant items, so you know where you are. But, if you click Lunch or Dinner, those items don't expand. They just load their taxonomy page.

#5

budesigns - June 6, 2009 - 15:14

Yes, seems to work in your example.
I have it set to only expand one branch at a time. Not sure if that should make a difference... So, while on Delicious Pear, I would not be able to see the children of Apple. And when clicking Apple, I'd want it to expand (and subsequently close Pear, I guess)

#6

Arancaytar - June 6, 2009 - 15:49
Title:Pages are loading when categories should be expanding instead» Custom menus outside active path not being loaded
Status:postponed (maintainer needs more info)» active

I can reproduce a slightly different, but likely ultimately identical issue.

Regardless of the "only one open item" setting, I can only see the "Delicious Pear" link when I am either on the "Pear" page or the "Delicious Pear" page. If I am in the top vocabulary item, or on a different page altogether, the "Pear" category will show up as a leaf with no sub-items; the node item won't be loaded underneath it.

This means that DHTML Menu cannot load the node item, and will only display it when it is already loaded by the menu system itself.

It might not be unique to taxonomy_menu; I'll have to experiment with custom menu items in general.

#7

Arancaytar - June 6, 2009 - 15:59

theme('menu_item_link') is called with $has_children set to 0 for the taxonomy link.

The basis for how this "lazy loading" works is that the menu system will declare an item as "expandable" (so it gets the arrow icon instead of the circle) but not load its sub-items (unless it's set as expanded, or always open). If the menu system declares the taxonomy term a "leaf" item, then DHTML Menu won't do anything with it. Needless to say, if the menu system claims that a menu doesn't contain anything, then DHTML Menu won't try to load contents.

This may be a bug in core (or it may be declared "Won't fix") but DHTML Menu can't do anything about it...

#8

Arancaytar - June 6, 2009 - 16:21

Not a core bug. After disabling taxonomy_menu, I can expand all the menus dynamically. There seems to be an issue with the way taxonomy_menu handles the menu tree.

#9

budesigns - June 6, 2009 - 17:55

Thank you for looking into that! Very helpful.

One other thing. Actually, some parts of the menu outside the active trail do load. Just not any categories at the same level as the parent of the current node.

I've rewritten this so it's more concise (hopefully) and posted it as an issue for Taxonomy Menu.

 
 

Drupal is a registered trademark of Dries Buytaert.