Closed (won't fix)
Project:
Menu Trails
Version:
5.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Oct 2007 at 08:45 UTC
Updated:
24 Jul 2009 at 16:12 UTC
Is it possible to use this module to set a non-primary menu as active ?
Assigning this setting is possible (every menus are displayed in the settings menu) , but I can't find the way to substitute the menu function in template.php, and don't know if it's ever possible.
Thanks.
Comments
Comment #1
yraber commentedJust to be a little more precise, the context is already right , it opens the right menu tree, the only thing that's missing is the "active" tag on the menu list element, so that I can put it in bold.
Comment #2
neurojavi commentedHi:
I've solved this issue using this http://drupal.org/node/77485#comment-433733 to add the active-trail class to the li elements.
This works fine since this module takes care of setting the active trail...
You have to add this to your theme template.php:
And use something like this in your css (note the > symbol!):
Perhaps it would be useful to add a note to the documentation about this...
Very useful module!
Many thanks the developer.-
Comment #3
encho commentedStrange, does not work with me. If I have a list or node that falls straight under primary menu, it works fine, but when selecting individual node (although its node type is declared in menu trails types and its category too), it does not have 'active' property!
Comment #4
neurojavi commentedHi encho:
If you have included the above code in your theme then you should have an "active-trail" class in your li elements (not an "active" class).
You can change the code to add "active" instead of "active-trail" if you like...
If this is not your problem please be more explicit on what have you done...
Comment #5
encho commentedThat's exactly what I did. It still does not appear. I am using modified Zen theme. active-trail does not appear anywhere.
Comment #6
neurojavi commentedThat's strange...
I use a modified zen theme too.
Have you changed the name of the function to match your theme (zen) or subtheme name?
thenameofyouthemehere_menu_item()
I you did it, can you put a echo inside the function (first line) so you can see if the function is called?
The problem can be in the function not being called or in _menu_get_active_trail() not returning the right value...
Comment #7
vistree commentedHey!
Tried your solution together with the menu-trail module.
Works GREAT for Firefox (2) but is ignored by the IE 6.
Is this the same for you?
Tried out with bluemarine theme and the following modifications:
* created a custom menu called "Mainmenu" (to be display as "normal" vertical menu in the left-sidebar!!!)
* installed menutrails-module and used the Mainmenu as parent for primary AND secondary links
* filled the following code in a fresh template.php
* filled the following code in the existing style.css
This works fine for the Firefox but is ignored by IE (I use the version 6.0)
Is there any help?
Regards
Kai
Comment #8
encho commentedNo output... Can you give me your template.tpl.php (or at least related parts), so I can overwrite my template.tpl.php and try yours? Maybe I have some conflict elsewhere in the template? Still banging my head...
Comment #9
vistree commentedHi encho,
I just tried out with the standard bluemarine template! Try out with one of the original phptemplates ones, too - not with your own as a first step.
Open (or create??) the template.php in the root directory of your theme.
Then include the following code:
Be sure of the two important factors:
don't include the starting "
" and ending "" twice. So if you modify an existing template.php leaf them away.Be sure that there are NO characters or linebreaks after the closing "?>" .
Fill in the previous mentioned code in your css.
If this works (don't test with IE!!!) then you know, that there is something else wrong with your theme.
Regards
Kai
Comment #10
vistree commentedaaah, and be sure, you name it template.php and not, as mentioned in your post, template.tpl.php!!!!!!!
Comment #11
encho commentedtemplate.tpl.php was a typo :-)
It is driving me crazy, still not working... Only thing I could think of was that some other module causes conflict, will try this in another installation as soon as I get some time.
Thanks for your effort though.
Comment #12
neurojavi commentedHi:
What version of zen theme are you using?
Are you modifying a subtheme or the main theme?
Please post here your template.php file
Comment #13
primalmedia commentedMany thanks! This worked for me
Comment #14
capellicThank you for posting this! I was in the same boat.
Note that I skipped step #2 in the installation instructions found in the module's README.TXT file - I didn't need it.
For those having problems with the trail showing up on secondary menus, be sure you check your HTML to see if it has the "active-trail" class on the li tag. Then you know it isn't a problem with the code or module, it's a problem with CSS. I had to massage the CSS code a bit to get it to show up and it looks like this:
#block-menu_trim-2 li.active-trail a,
#block-menu_trim-2 li a.active {
color: #008acb;
}
Yes, I am using this in combination with the Menu Trim module - works great! (Maybe this is why I didn't need step #2 - maybe Menu Trim was already doing this?)
Comment #15
sunSorry, Menu Trails for Drupal 5 is not actively developed/maintained anymore. Only issues containing patches may still be considered. Feel free to re-open this issue if you want to provide a patch.