[themes] Overriding menu_tree

Mark Ferree markferree at gmail.com
Fri May 4 13:43:47 UTC 2007


Thanks for that link, it definitely gives me a much cleaner (and probably
faster) way to strip my class and id from the sub-menu.

Through this problem, I have already learned more than ever wanted to about
how Drupal's menu system works, and I just read its been completely
rewritten for 6, cest la vie.

Unfortunately  the class and id are still not being applied to the parent ul
that contains my nested lists.

In 4.7 the same classes and ids were applied to every ul in the menu
structure including the parent.

You mentioned that the menu system drops in and out of the theme system.  Is
it possible that as of version 5 template.php isn't called until after the
parent list is themed by the core theme_menu_tree function?  Doing a search
of all of the core drupal files I couldn't find anywhere else the class
"menu" was being applied except menu_tree.  I haven't tried to modify
menu.module yet, but I'll try today to see if that fixes my problem.

On 5/4/07, Larry Garfield <larry at garfieldtech.com> wrote:
>
> Have a look here: http://drupal.org/node/138656
>
> I was tackling a different issue there, but the structure for what you
> want is
> probably the same.  Be sure to see the descriptive text to explain what's
> going on.  Menu theming is a bit weird in that it jumps in and out of the
> theme system proper, but you can pull it all into the theme system that
> way.
>
> On Thursday 03 May 2007, Mark Ferree wrote:
> > Drupal by default uses the theme_menu_tree function to apply the class
> > "menu" to all menus throughout the site (except for primary and
> secondary
> > menus which use a different function).  When I did an override of the
> menu
> > in 4.7 the parent menu as well as the sub menus were changed, but as of
> > version 5 the only class that is changed is the class on the sub-menus.
> >
> > I have been through the theme handbook several times, as well as
> searching
> > the forums and the archives of this list for anyone having similar
> issues.
> > I have a feeling that changing the class isn't something that is done
> very
> > often, due to the fact that you can easily modify your css to hook into
> the
> > correct "menu" class, unfortunately the javascript menu I am using (udm)
> > isn't as flexible.
> >
> > On 5/3/07, Jason Flatt <drupal at oadaeh.net> wrote:
> > > On Thursday May 3 2007 7:59 am, Mark Ferree wrote:
> > > > Two days later, and I still am only able to override the class and
> ids
> > >
> > > of
> > >
> > > > the nested sub menus on my site, and not the top level.
> > >
> > > You might try using Firebug's inspect feature in Firefox to determine
> if
> > > you
> > > are overriding the correct classes and/or ids.
> > >
> > > --
> > > Jason Flatt
> > > http://www.oadaeh.net/
> > > Father of Six:  http://www.flattfamily.com/ (Joseph, 13; Cramer, 11;
> > > Travis,
> > > 9; Angela; Harry, 5; and William, 12:04 am, 12-29-2005)
> > > Linux User:     http://www.kubuntu.org/
> > > Drupal Fanatic: http://drupal.org/
> > > _______________________________________________
> > > themes mailing list
> > > themes at drupal.org
> > > http://lists.drupal.org/mailman/listinfo/themes
>
>
> --
> Larry Garfield                  AIM: LOLG42
> larry at garfieldtech.com          ICQ: 6817012
>
> "If nature has made any one thing less susceptible than all others of
> exclusive property, it is the action of the thinking power called an idea,
> which an individual may exclusively possess as long as he keeps it to
> himself; but the moment it is divulged, it forces itself into the
> possession
> of every one, and the receiver cannot dispossess himself of it."  --
> Thomas
> Jefferson
> _______________________________________________
> themes mailing list
> themes at drupal.org
> http://lists.drupal.org/mailman/listinfo/themes
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/themes/attachments/20070504/0ed99867/attachment.htm 


More information about the themes mailing list