By mediamash on
menu_item_link() generates links for menus, it calls internal link format function l() defined in common.inc which returns anchor on a array in our case its menu items.
say if i want to add span tag within anchor how shoul we change the following default code and overwrite it in template.php
function theme_menu_item_link($item, $link_item) {
return l($item['title'], $link_item['path'], !empty($item['description']) ? array('title' => $item['description']) : array(), isset($item['query']) ? $item['query'] : NULL);
}
Comments
Something like
Something like this
But if all you are using the span for is to add a class name you could do this instead
menu_item_link($mid)
I want to add an active trail to menu_item_link (the A tag) , just like this code adds an $active_class to the LI tag
grtz
tom
How about this (notice the
How about this (notice the call to menu_item_link() is changed)
the output here is 'array'
the output here is 'array'
my output for the_links function should be
<a href="url_here" class="ACTIVE">title_here</A>Sorry, late night reading,
Sorry, late night reading, change
to
strange, only the LI-tag
strange, only the LI-tag gets an active class, i need the a-tag to have one too