Hello
I have configured Active trail in the admin but with my zen theme it does not work out the box. Should I edit the template.php and add some lines?
The documentation don't speak about it, it seems to be so simple :)
Thx a lot if you can share a solution.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | template.php_tinker.php.txt | 8.24 KB | Milkrow |
| #8 | template.php_subtinker.php.txt | 6.02 KB | Milkrow |
Comments
Comment #1
pulse8 commentedI'm also seeing this issue. Everything appears to be installed and configured correctly, but it doesn't appear to be working properly. It won't set the active status for node pages and I can't tell if there's something else I should be doing. I haven't modified the Zen theme code at all. Just changed CSS.
Comment #2
bitstream commentedI'm also having the same problem. I found that Zen overrides the phptemplate_menu_item_link() function, in it's main template.php file (not the one of the sub-theme). I tried removing the override but it still doesn't work. Hope that helps,
Bitstream
Comment #3
bitstream commentedI fixed it. That's how i did that:
First, in the READMET.txt file of the module, there is a snippet, which you should put in your template.php file. The snippet is:
But when you put it in template.php file of your zen sub-theme, it echoes an error. The thing is that this function is already defined in the original zen template.php file. So, in order to fix this issue, you have to merge the two functions.
The following code is my current zen/template.php file:
If you copy that code and paste it over the function definition in your zen/template.php file, it should work.
Comment #4
bitstream commentedForgot to say, I'm using Drupal 5
Comment #5
floown commented@bitstream : the bug I tell is in Menu Trails 6.x-1.0.
Comment #6
eojthebrave@floown: Couple of thoughts.
Does your theme already implement an override for the theme_links() function? It would be in your template.php file and named THEMENAME_links()? If so, you'll need to reconcile the differences between your theme's _links() function and the phptemplate_links() function menutrails.module. If this is the case and you're struggling with it can you post the code for your THEMENAME_links() function.
Alternately, can you check and see if your menu li tags have a class of "active-trail" for any menu items that should be in the active trail.
I've used this module in conjunction with zen sub-themes on a number of sites so it is doable.
Comment #7
Milkrow commentedI'm using Drupal 6.10 and I can't get menu trails to work with my Zen subtheme either. I don't see a PHP error when I install and configure trails. I don't see ANY snippet in the README.TXT file (or any other file in the folder) and since I don't see an PHP error I can't determine what to override or reconcile between the template.php in my zen vs. subtheme folder. Some more specific directions would be helpful here. I tried adding the code above to both of my template.php (zen/sub) files and nothing changed (but I realize those directions were for 5.x, not 6.x). I'm not well-versed in PHP, so maybe I'm just not understanding something that is assumed I'd know???
Comment #8
Milkrow commentedA quick followup to my last post...I'm attaching files because it occurred to me that perhaps I'm pasting the snippet over something incorrectly. I don't see THEME_links (specifically) in my template.php files for either zen or my subtheme. Perhaps my template.php files are calling it something else related to $hooks? I'm just not PHP savvy enough I guess. I've attached template.php_tinker (from zen) and template.php_tinker_subtheme (from my subtheme). I finally found the snippet I think is being referred to in menutrails.module, but its not clear where to put it or what to overwrite (to me anyway). I think this just may be a naming convention difference between 5.x and 6.x, but if anyone can shed light on this for me, I'd really appreciate the help!
@eojthebrave: I inspected the primary link LI that I'd configred via Menutrails and I did see "active-trail", but does this mean:
- the override exists and must be reconciled?
- menutrails is working?
- I did it all correctly, but there is some other error?
Comment #9
jkopel commented@Milkrow I just went through this as well.
One thing that was hung me up was forgetting to clear the theme registry after installing the module!
If you see the "active-trail" then it is working, and all you have to do is edit your CSS to add the li.active-trail class.
Something like
li.active-trail a, li a.active { color: red; }
Comment #10
Milkrow commentedExcellent advice! Thank you!
Now I'm scratching my head on this one...
Nodes whose menu attribution is Primary Links cannot, by default, be included in submenu blocks I've created. In other words...
if...
I have a Primary Link item called "About",
I have a submenu block called "About_Submenu",
I have a node called "All About Me" (node/15)...
and...
I want to set the parent menu of node/15 to "About_Submenu"
...then the class .active-trail doesn't show in the list menu.
Rather, I seem to be forced to create a separate menu item called "All About Me" in the "About_Submenu" block and point it to node/15.
This sort of defeats the beauty of being able to create nodes and set them inside submenus via the parent menu setting, doesn't it?
Does that make sense? If so, am I configuring this all wrong? I'd really like to avoid going back and recreating sub menu items for all the nodes which are already attributed to via the parent menu settings.
Any thoughts?
Comment #11
sunMarking as duplicate of #328517: Having menu highlighted when I visit individual nodes.
Comment #12
rohnjeynolds commentedSee my comment on the duplicate ticket:
http://drupal.org/node/328517#comment-2011820
Disclaimer: Just got positive results with this fix, but don't know yet if it will work for everyone or if it doesn't introduce other problems.