开发者

Theming certain pages in drupal

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜