Hi there,
I have a main navigation menu in my Drupal template which has a series of links for each of the key pages. One particular link is for my 'News and Events' section i've created. This menu link has no child links branched underneath, but the 'News and Events' page as a whole does point to other nodes via its 'View' generated list (Individual news/event pages).
Unfortunately, where by visiting the 'News and events' main page will highlight that item linked in the menu (To give us an active trail), clicking the non-menu linked child nodes loses the highlight and the active trail.
Considering that the 'Menu Trail' module is not Drupal 6 ready, I have had a good search around and I found some code which produces a related solution of sorts... http://groups.drupal.org/node/9706 ...However, this only works for Primary/Secondary links which only support one level of links. Had this theme function worked for the main navigation, this would have been great.
Does anyone have any suggestions/solutions to this problem?
One idea i've thought about is to have the main news and event page have the address "/news-event" which is linked in the menu. The child nodes coming off this page would then follow the convention of /news-event/newspage1. With such a scenario, would there be a way of overriding one of the menu functions to start drilling "up" the path to set the 'active' class to its nearest match?
Comments
Ah, you ran into the same
Ah, you ran into the same problem everybody is running into (or at least the ones that want a consistent navigation, for example drupal.org lacks consitent navigation!).
A quick fix is to link the nodes tho te menu and disable them afterwards. That way the menu link is not visible but the parent stays highlighted.
-----------------------------------------
Joep
CompuBase, Drupal websites and design
Can that be automated for a
Can that be automated for a content type?... i.e... set the content type for the hidden pages to be added to the menu, but be hidden?
You will need to write a
You will need to write a module for this.
-----------------------------------------
Joep
CompuBase, Drupal websites and design
i don't know if it will
i don't know if it will solve your problem, but menutrails does have a d6 patch you might want to try.
===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime." -- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz
Just to come back to this,
Just to come back to this, this still seems to be a very common problem which is no closer to being fixed, apart from Menu Trails seeming to be getting very close.
Here are some things/thoughts which might be starting points:
1) I did find the menu_set_active_trail (http://api.drupal.org/api/function/menu_set_active_trail/6) function in the API, which would open up the possibility of improving the active trail generation. But how would be the best way of trying to override or re-write this function without touching the menu.inc file?
2) Alternatively it would be useful if per content type you had the option of defining a default menu link to highlight if the page isn't within the navigation menu. So /newsandevents/news would always highlight and be open if you were on the unlinked /newsadnevents/news/newsitem1 page.
Menu Trails seems to almost do the above, but you can only select one navigation block to apply settings per node type and does not fully support view generated pages. Probably the closest solution to something!
subscribing
subscribing
subscribe
subscribe