I've got almost the same question. It sounds pretty stupid, but I couldn't find a way to do the following yet. I need to modify primary links output (add an extra div after each li). I tried overriding theme_menu_item() in template.php, but it affects all menus on the site (navigation, etc). How do I specify which menu to modify?
You have to catch the primary links call and alter as you need.
//Catch only the Primary links
function phptemplate_links($links,$attributes = array('class' => 'links')) {
switch($attributes['class']){
case 'primary-links': return themename_primary_links($links,$attributes);
break;
}
}
//The above calls this, when Primary links are fired, and catchs the call
function themename_primary_links($links, $attributes = array('class' => 'links')) {
.... Your looping code for what you want to do goes here...
}
Comments
...
What are you trying to do?
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
I've got almost the same
I've got almost the same question. It sounds pretty stupid, but I couldn't find a way to do the following yet. I need to modify primary links output (add an extra div after each li). I tried overriding theme_menu_item() in template.php, but it affects all menus on the site (navigation, etc). How do I specify which menu to modify?
In your template.php
You have to catch the primary links call and alter as you need.
Thank you! This was really
Thank you! This was really helpful.
You can do drupal theming of
You can do drupal theming of menu by using the snippet on the link.