I'm running D6.
I have a menu, that's not primary links, it's a menu built from scratch that I've called Global Navigation. It's a site-wide menu. When I'm in a section of the site (from the Global Navigation) let's say Section 1, I have a sub-menu (Section 1 Menu) that display as a block (only in that section).
The problem, and I've read lot's of posts and tried many solutions, is very popular: The item Section 1 from Global Navigation Menu, looses class active when I navigate trough the Section 1 Menu... I've been in common.inc, menu.inc, template.php ... No solution.
What I like to have is (horizontal main menu, left-vertical sub-menu):
Section 1 | Section 2 | Section 3 | Section 4
Sub-Section 1
Sub-Section 2
Sub-Section 3
Instead, every time I navigate to a sub-section main navigation looses active.
Shouldn't there be a solution for this issue? Based on url... the sub-section are always inside the main directory...
section1/subsection1
section1/subsection2
section1/subsection3
section1/subsection4
??
Anyone has an a solution that works?
Thanks in advanced.
RB
Comments
Comment #1
ainigma32 commentedThat sounds a lot like this issue http://drupal.org/node/350516
Unfortunately there doesn't seem to be a solution yet.
Maybe you two can work together on this?
- Arie
Comment #2
dman commentedMain navigation is not 'active', it should have become 'active-trail', use that class instead.
See menu_navigation_links().
Results may vary according to your theme.
... or is the problem specific to your use of split menu blocks?
... or, reading again ... have you actually built two+ menus, and the parent one is not really a parent of your subsections??? Well there's your problem!
Try building one big real menu (not lots of fragments) then if you want to just show context-sized local menu blocks, use
http://drupal.org/project/menu_block_split (automatic second level context menu block)
or
http://drupal.org/project/menu_block (choose a menu branch and place it)
or .. well there's lots.
But it's most helpful if you build your menu in one tree, like a site map. Multiple menus is to be avoided unless they have nothing in common.
Comment #3
ricardobaeta commentedHello,
I build a big menu like you said, and installed menu_block. All ok, now I have active-trail class that I can control and sub-menus in blocks.
Another problem came with that... now when I click on the main navigation links, they expand the child items...
Css display: none; doesn't look very well to work around... Do you know how to "not expand child items" when main parent is active?
Thanks in advanced.
Best Regards,
Ricardo
Comment #4
dman commentedIf your 'main' (tab-style) top menu is the 'Primary Links', and uses the primary links renderer in the template, then you will just get the top level like you want.
That's what the primary links behaviour does. Work witihin the system and you'll probably find that the normal behaviour is normal.
If you've placed your top menu as a block, you will be getting expanded trees and stuff.
You can change which is primary links in the menu settings config page.
Comment #5
ainigma32 commented@ricardobaeta: Can you confirm that dman's advice worked out for you? Or are you still struggling ;-)
- Arie
Comment #6
ricardobaeta commentedHello Arie,
I used menu_block and that worked. A ugly solution because I have to css (display:none) to ul li ul li main navigation... when you enter in a main section the main menu expand... ugly indeed.
Ricardo
Comment #7
dynamind commentedIt seems you were fighting the same problem I was. Does the following post address your problem in a better way?
http://www.touchdesk.nl/2009/04/full-menu-tree-with-active-trail-in-drup...
Comment #8
dpearcefl commentedClosing this issue because of a lack of activity.