By chrissmiss on
I'm using D6.14 & Menu Trails...and I've read a lot, but can't find a solution !
Menu 1
-- Sub A -> <li class="leaf first active-trail">
when loading (one of) the dedicated node(s)
Menu 1
-- Sub A -> <li class="leaf first">
the menu remains expanded but loses its active style/status.
Comments
Try out Menu Trails module,
Try out Menu Trails module, should do the trick.
using Menu Trials without effect
THX....
I use Menu Trails already... that takes no effect... is there an other solution?
Are you certain you've
Are you certain you've configured it correctly? It should work as expected. From the project page it says:
"The module provides a means of broadly categorizing nodes (by type or taxonomy) as falling "under" a known menu item. These nodes are not added to the menu tree (keeping the menu admin system sane) but they will trigger the functionality above -- preserving navigation state for the user -- when viewed."
Try to clear all your site caches at Site configuration -> Performance
Forgive my ignorance, but
Forgive my ignorance, but what do you mean by 'dedicated node'?
Contact me to contract me for D7 -> D10/11 migrations.
There is no problem with Menu
There is no problem with Menu Trails. The "active trail" is OK just using the terms.
If you click a node (from a list of dedicated nodes to the menue) the "active trail" get lost.
Again, what is a 'dedicated
Again, what is a 'dedicated node'?
Contact me to contract me for D7 -> D10/11 migrations.
Sorry.....for my confusing
Sorry.....for my confusing description!
I have a menu on the left side.
If I click on a term the term get its "active trail", a class "active" and a list of nodes appears.
now I click a node from the list, the site refresh and the "a class=active" get lost.
Ok, now I see your problem.
Ok, now I see your problem. The active trail is set when you are on the URL that a link refers to. The URL for you refers to the page that lists the nodes. Once you click on a node, you are taken to a different URL, which means that the menu link is no longer the active URL - you are looking at a different URL.
I don't know if there are any modules to solve this. I had a similar situation arise with a site I built a couple of months ago, and I think I just ended up analyzing the links in my template.php file in one of the preprocess functions, adding the trail that way. But I was doing it off a taxonomy term, so I don't think that it would help you in your situation.
Contact me to contract me for D7 -> D10/11 migrations.
Thank you... I think I'm not
Thank you...
I think I'm not alone with this Problem ... maybe there is a solution!
I'm working with this issue
I'm working with this issue also. I have 'primary links' in the header and a sidebar menu for the different nodes in the section. The sidebar menu is really jsut a view listing, if that matters.
If you are on the 'main' node in this section, the one linked directly to the primary links menu, the active trail on the menu is set. Once you click on the nodes from the sidebar, the active trail goes away.
I noticed that if i edited the nodes from the sidebar to have a menu item in primary links menu, the active trail class is set correctly. the thing is that I have the child links of that menu showing as a submenu for other sections, but for this one section I do not want to show these links as they are many, and we have them already in the sidebar. so now I go to 'edit menu' and disable my child node link. Now I get what I was after: the main menu item is highlighted, the child links are NOT showing, and all the sidebar node links work as expected.
So this is sort of a solution, except that I think there must be a better way than making a menu link and then disabling it each time. I can't ask my client to do that every time he adds to this section!
I'm thinking there must be a way, maybe a preprocess function that says for every node of this type, make this particular menu link have 'active trail' class. I'm not a master function writer so before I try my hand at it I thought I would check to see if others think it's worth trying or if it's been done before.
Seems logical though, right?
Try this:
on preprocess page or node
in $item['href'] put path from menu item.
One step further
If you're frustrated by the item not having "active" in it (we use the nodetrail dev module which accomplishes a similar thing as menu_set_item solution), you can write a simple CSS selector.
.leaf.active-trail > a {
font-weight: bold;
}
While this won't sync with the "active" class (you could write jQuery to select .leaf.activetrail > a then add the class 'active' to it), it is a very simple fix. So nodetrail + this CSS will allow a "hidden" page to have a specific menu item highlighted. Set the node trail parent item, which will then be the last "leaf" in active-trial.
HTH,
Ryan