I need to theme tabs on a certain number of pages "user/". If i simply use theme_menu_local_task in template.php, it will use the function on all pages, not only on "us开发者_Python百科er/". Is there a way to theme only "user/" pages and leave others alone?
Here is an approach:
function mytheme_menu_local_task($link, $active = FALSE) { // for paths you want to override the theme: if ($_GET['q'] == 'certain/path') { return '... my theme ...'; } // for other _normal_ paths: else { return theme_menu_local_task($link, $active); } }
Note you have to call return theme_menu_local_task() directly or your code will trapped in an infinite recursive calls.
精彩评论