By DssTrainer on
Hi,
I just switched from WordPress (garbage) to Drupal and I'm ecstatic that I finally found a great CMS/blogging platform that works properly and doesn't have improperly ported themes that wordpress and the rest pass around like cheap whores, leaving things out each time.
The only problem/confusion that I'm having is on one of my menus I have a child menu. I would expect the child menu to show up only when I click on the parent menu link however it does not show up at all. The child shows up fine if I set the "Expand Always" checkbox on the parent menu, but how do I get it to only expand when active? Is that a setting that I've missed somewhere?
Comments
Two menu items for one path
Hi DssTrainer,
Check out your /admin/menu/ page. Do you have two or more menu items that point to the same path?
The most common cause I've seen for this behavior is having two or more menu items pointing to the same content (i.e., two or more links pointing to a particular node).
I think this is how it works...
I like to think of the Drupal menu system has being very similar to the traditional concept of a sitemap. A traditional sitemap lists every link available on the site, usually grouped together.
The menu system is such a list of links, but this time with your Drupal paths (such as nodes).
It is key to differentiate between menu items and paths. Drupal's menu system (or sitemap, as I like to think of it) is based on paths. Menu items are more or less just labels for paths. Parent/child relationships are based on paths, not menu items.
A common source of the behavior you are noticing is having two menu items pointing to one path, ie:
So now Drupal has to decide which menu to display: the child [node/4], or the parent [node/4]. Which to display as currently selected? Which to display as expanded? How can the child of [node/1] also be the sibling of [node/1]?
Well, from what I can tell, Drupal will determine this based on ranking in the menu system. Those earlier in the menu will be chosen. So in the example, the child [node/4] is displayed. The parent [node/4] is all but ignored and thus not expanded. So:
Let me know if this helps, and good luck!!!
Thank you for your detailed
Thank you for your detailed reply :) I understand what you are saying. I will check that out to see if it is getting called anywhere else. I'll even try deleting it all together and creating a new link to see if that fixes it since Im sure a new link wouldn't be in 2 spots yet.
Thanks again!
Did this work?
Hey DssTrainer,
Did this resolve your issue?
Please reply so that others who run across this thread can learn from it.
I had exactly the same
I had exactly the same problem and it was because I had another link to that same top page. It seems as though the order in the db is what counts, whichever link was put in first will be the one to take precedence.
same here too, except ...
Child items DO show up when I force navigate to a child page via content manager.
But they don't pop down from the parent menu, nor do they appear when in the parent page. Of course I can force them to be there with "show expanded" but that wrecks the popdown menu.
I tried cleaning the menu of conflicting and misordered items as evo said (thanks evo - that helped me understand the Way of Drupal). I even tried linking to the nodes directly in the menu (rather than aliases) but still no joy.
Is this true for anyone else?
Same problem
My only difference is that I created two custom menus: the first one with 1 parent and 10 child elements is working perfectly, but not so the second one with 1 parent and just 2 child elements (they appear if I check "expand" in parent, but not otherwise, anyway I need the same behaviour than in my first custom menu -the 1-10 elements one-)
I have double checked that there are no duplicates in my neither in my custom or navigation menus: both checked that there are no duplicate names nor paths but still no luck.
I will reset the menus to the default state and will rebuild my custom menus (it will take me a while to rebuild the first custom menu).
I will come back here to say if I had success.
This did the trick for me
After double-checking that I had no repeated links in any other menus (I found one directing to the forums, but wich did not duplicate in the menu I had trouble with, however I deleted it just in case...) I deleted the former malfunctioning menu items from the bottom to the top elements one by one: first the children then the parent element then the menu.
Afterwards, I created a different menu with different names and different links and started modifiying one at a time in order test each element one by one to spot the troubling one:
One (parent)
-Two (=child 1)
-Three (= child 2)
Then I renamed and changed the link on the parent
News (parent)
-Two (=child 1)
-Three (= child 2)
Then I renamed and changed the link on the children one at a time, so first:
News (parent)
-Center (=child 1)
-Three (= child 2)
and then
News (parent)
-Center (=child 1)
-General (= child 2)
And that did it. Don´t know exactly why, but now it works.
more non-expanding menus
Same issue... I don't see any duplicates between menus because they are all new items. I'm not sure why it should be such a disabling issue even if there were duplicates? Has anyone else found a slightly more consistent way to address this? TIA GZ
found a fix for mine
riley-huff
I was able to fix this problem. In my case the parent item was using a absolute url, from within drupal. I edited the parent item to have a relative url and it worked!
Just dealt with this
Just dealt with this issue... and Steve's solution seems to be correct. I had a Primary Links menu item that pointed to the same page as a custom menu link, so the custom menu link wouldn't expand. I deleted the Primary Links menu item, verified that the custom menu link worked properly with the expand and collapse, then rebuilt the Primary Links menu item. All works well now. Thanks for the tip.
Happy day,
Anne
Bummer-- I'm still having the same problem
I've deleted my Primary Links menu and rebuilt a new custom menu, but my list won't expand unless I force expand it :(
Got it working
Basically you can't have any duplicates in your default Navigation and your Custom Nav. I created a custom nav and then moved items from the default Nav to custom nav.
locked items
What do you do with locked items, like my account or my blog? You can't deactivate those or move them anywhere. They just keep blocking the custom menu.
not expanding
Hello.
Thanks for your input to this subject. I was hoping you or maybe someone else would point a newbie in the right direction.
I think my problem is that I don't understand the whole "node/add" thing in the path. Or it is that I'm having trouble diff between
menu item and path. (btw - I currently have no related primary links)
Seems I always use "node/add" in the path. In most cases, I can see the node number on the resulting page but, then I've actually seen "node/add" in the URL and get confused. In the admin I can clearly see the parent and the child but, when expanded is not checked, I get no result - it won't expand and I can find the related child article.
Any suggestions?
tx,
zb
same problem
Same problem with drupal 5.2. I check that i have not any duplicate url :(
Menu EXPAND property not working
Moving my recent post here because it is same issue. This has either got to be a bug (who'll take it on?) or poor documentation (we need somebody to explain and contribute). Thanks in advance!
Ok, 4 months now of reading the site cover-to-cover and lots of experimenting, but...
Can somebody explain exactly how the Expanded attribute works in default menu module?
Better yet - please refer me to a comprehensive document that comprehensively shows the use of the Expanded property.
What I want is so basic, but I can't get it to work reliably and confidently. What is needed is a standard heirarchical menu:
1. Navigation menu, add four items at highest level, with "Navigation" as parent; e.g. Item1, Item2, Item3, Item4
2. Each menu has several menu items below the first tier, e.g. Item1-1, Item1-2, Item1-3, Item1-4
3. Some menu items go down one level deeper, e.g. Item2-3-1, Item2-3-2
4. The menu items are hierarchical and exact replica of the taxonomy hierarchy that I am using
5. Most of the menu items point directly to a custom view using the standard Views module
6. Other items point to a simple temporary page node with body = "Temporary page"
This has got to be simple, but no docs, no answers, no logic. Thanks for the help!
NICE Menus Module!
NICE Menus! What a great module. Absolutely zero setup time and the menus collapse and expand like magic. Never looking back.
not nice on 5.2
I got the same problem.
(no path duplication, but not expandable menus, may be deleted primary links caused the problem)
Tried nice menu module, but admin/blocks/nice_menu/configure goes out to the white emtiness (on every default theme)...
Not ready for 5.2, and I tink this problem is on it only.
(On 4.7 nice menu is a great module, I agree.)
I found a way to make menus work better
See the bottom of this thread: http://drupal.org/node/147404
- it shows how to split the primary menu (in the header) from the secondary (in the left or right column). Expanded menus work properly for some reason when I couldn't get them to work otherwise.
Consider Fieldset Menus Module
This isn't quite the same issue, but I also found that the drupal menu's system of opening the page of a parent item (default collapsed) in order to see the children item was unintuitive- the average user expects the menu to expand, not to go to a new page and then expand. I tried nice_menus for a while, but it didn't work as well as I expected, and the way that it disappeared without delay when your mouse moved off the menu created usability issues. So, I created a new module, called fieldset menus in order to simply expand parent items- not change the page. I suggest that, if you're having trouble with drupal's default menu system, you try this module.
-cwgordon7
Other reasons why menus don't expand
I've found that if there are any encoded characters in the path, then they will not expand properly. For example I was using a view & argument for a page - let's say the view url was services and the argument was community members. I thought I was being smart by setting the path for the menu to:
services/community%20membersNotice the %20 - an encoded space. Turns out drupal is happier with a real space:
services/community membersFWIW
A lot more info
See my bug report here for a detailed examination of my issues with this.
In summary, I found that using the Menu API wasn't very good for expanding items (in Drupal 5.3 at least). You could use it to create items but then you had to comment out the code to get the expansion working. Still trying to resolve it but I'll probably circumvent the menu API and just use db_query().
This is interesting, I'm
This is interesting, I'm trying to do just the opposite, child menus appear under their parent but I don't want them too, i'm using related links to list subpages in a different block
More (or less) expanding menus / db_query
Hello there,
I read your bug report and can (almost understand).
A few questions...
1. How can I use db_query to get around the problem with drupal api?
2. Where exactly do I use it (as in where is the code in question - I am new to drupal and having problems finding some of the code).
I have 3 items in primary menu, each of which should expand into 3 items in secondary menu. Should not be so hard but this is stopping me uploading my site now!
Please see....
http://drupal.org/node/198042
For more detailed explanation.
Thanks!
Kind regards
NICK
Way I got around it
Hi Nick,
Here is the code I used to get around the problem. It specifically builds child menus dynamically by inserting records directly into the menu table. A bit hackish, but what can you do when the API is malfunctioning?
In which page do I have to
In which page do I have to copy this?
Because I'm not that good in changing the right files and so on.
Thanks already!
-----------------
..::Bjornovich::..
Problem with son of suckerfish multilevel menuing
Hi,
I'm using son of suckerfish css/javascript menuing in a drupal site i'm working on. Previously I have used Nice menus for multi-level dropdowns but this time it was decided the lighter son of suckerfish was the best option! My issue is with the expansion of list items. The top level works without a problem but when I check the box in the menu admin to expand child elements from the top level I'm having difficulty controlling when the child element appear and it's placement in relation to it's parent.
Any suggestions would be very gratefully received.
Cheers,
John.
Child Menus
I found the problem to be on the page level.
When you create a page or story you need to add the menu information at that time. If you do this child menus and pages expand just fine.
If you create the page and then use the menu module to add the page to a custom menu, child menus do not expand.
I have tried this both ways now several times. I am able to recreate and fix the problem each time.
Not a fix
Intersting topic... and thanks for posting this! Wish I had found it before.
this seems the be only way wihout modules - http://drupal.org/node/194813
Many thanks for your time and sharing!
Subscribing, having the
Subscribing, having the -not-expanding issue with taxonomy_menu when I change the taxonomy/VID/TID/TID url to a userfriendly one using custom_url_rewrite.
If I keep the url to taxonomy/VID/TID/TID the child menus nicely expanding!
greetings,
Martijn
Drupal of Lost Children
I ran into this problem due to a custom translation module. I had all the global menu variables set properly ([items] - title, path, type, pid | [path_index][path] = $mid) but English (secondary language) menus wouldn't expand. Found out the children were lost and all that was needed was a simple call to _menu_find_parents($_menu['items']). You can't trust parents to keep track of their children on their own.