Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
By peacog on
I've tried all sorts of things but I can't for the life of me figure out how to theme primary links in Dupal 6.x.
theme_menu_item_link() doesn't seem to be called for primary links so I can't use that. Instead menu_primary_links() is called but this is not themeable. I want to theme primary links so that I can get rid of the title attribute from the menu items.
Can anyone tell me how to theme primary links in D6, or failing that, how to display the links without the title attribute?
Thanks
Comments
theme_link
Documentation here: http://api.drupal.org/api/function/theme_links/6
Was looking for the same thing when I found your post... :)
Update:
Scratch that - I didn't get it to work myself... :(
theme_links is correct
theme_links is the function you want, I think.
Here's the code I use to theme my primary links at the moment. I'm changing 'Log in' to 'Welcome, @user' for authenticated users and hiding the Log in link from unauthenticated users. (The site's not quite ready for prime time, so I'm not ready to make the log in so obvious.) If anyone has improvements, please share!
So maybe you want to set $links['title'] = $links['href'] or unset($links[$key]['title'])?
Anyone know how to get this to operate only on primary links (in case someone wants to leave secondary links alone, for instance)?