Menu Trails, Active-Trail and Child links (not Secondary links) in footer solved with Menu Block (so far)
This post is about troubleshooting an issue getting "active-trail" to trigger for nodes set to a particular content type...also using Menu Trails. Menus populated with node links that have the block as the parent element will not trigger "active-trail" and therefore Menu Trails won't work and you won't get css behaviors to work. Have others used Menu Block to fix this or have others opted to hack core or make other theme.inc, menu.inc or page.tpl.php changes to affect desired menu behaviors?
I'm styling zen for a 6.14 Drupal site and was having issues with getting "active-trail" styles. I'd created a series of nodes that were tied to a submenu block that I created (there were several of these). For some reason, Menu Trails was not working. I couldn't get the primary link nav to be active for these "sub pages" of the section. What I found out was that those menu links in the block I'd created were being treated as external links and therefore would not trigger class="active-trail". When I changed the Menu Settings of those nodes to be associated with a primary link, the "active-trail" worked. But now my submenus were no good. I'd found another post about Menu Block. I installed that and voila, I could create a menu block that picked up all the child elements of the primary link. However, I mistakenly associated those links as "secondary links" (which they were not, proof: I looked at the item list in secondary links...which was empty...more proof, turning off the secondary link display in the theme settings yielded no results). So the issue was now that the childofprimary links were showing up in the footer...which I didn't want. I looked around and saw that there were solutions for removing ALL primary links, but I didn't see an option/setting for removing the child links (and/or I don't know how to write the correct php to exclude those). I figured setting li.expanded active-trail ul.menu to visibility: hidden would be wrong since it would leave the empty space...so then I realized I could use Menu Block to generate a new footer menu that ONLY showed the 1st level of Primary links. Whew. If anyone else has faced this and thought perhaps active-trail wasn't working or hacks to core were necessary, there are posts on that (but I found this wasn't the solution I needed):
http://drupal.org/node/249571#comment-941281
MENU BLOCK was very helpful.
http://drupal.org/project/menu_block
I also took a quick stab at DHTML menus, but could not get it to work (very cursory attempt). I also found that I could turn off Menu Trails because it wasn't working. When I set the parent element of a content type to reflect an active state ...it just didn't work. I don't know why. I could not find a topic that addressed that issue.
Feel free to post insights as to things I'm doing right or wrong. Thanks so much.
