By tasc on
Hello,
maybe someone could give me an advice on this or point me to some already existing thread...
I have a block-topmenu.tpl.php and I need to have access to the menuitems for css-tagging them individuallly,
like
<li class ="leaf leaf1" ... />
<li class ="leaf leaf2" ... />
Is there a proper solution instead of "parsing" the $block->content
Comments
Short answer
Theme overrides:
http://drupal.org/node/173880
This is most probably the themable function you'll want to override:
http://api.drupal.org/api/function/theme_menu_item/6
--
Anton
New to Drupal? | Troubleshooting FAQ
Example knowledge base built with Drupal
a similar problem
Hi,
I have kinda similar problem and i'm using Drupal 6.2. I know the themable functions which we can override. But problem is these functions override menu items of all menus. Whereas, i'm currently stuck in a situation where I have top and left navigation. All I want to do is assign a particular ID to top nav <ul> list and a particular class to its <li> items. I'm currently trying with theme_menu_tree($tree) function to override. Then there is menu_tree($pid) function which I can use to check my menu ID. But I can't find the $pid for my menu. This $pid doesn't come up in the source too.
I am porting an existing template to drupal so I have limitation adding new styles to the theme. Otherwise I would have done it easily.
Thanks and looking forward.
Rashid Aslam
Aspire Solutions
$pid
On the menu admin page, hover over the edit menu item links - the menu id will be in the edit url.
Note: some menu functions use the parent items menu id. The root menu id is 0 from memory.
--
Anton
New to Drupal? | Troubleshooting FAQ
Example knowledge base built with Drupal
Theming menu_tree
For now I'm using the following solution, where "clean" is my theme:
Now all menu_items are tagged, which I can live with.
Any hint of theming a menu residing in a specific block is much appreciated,
any info on where I could define this $extra_class as well !
(With dhtml- menu -module you'll have to "theme" their functions, it's a bit tricky though)
In Drupal 6, you can refer to
In Drupal 6, you can refer to tutorial on for theming of drupal 6 menus by overriding functions in template.php.