开发者

Theming certain pages in drupal

开发者 https://www.devze.com 2022-12-25 14:35 出处:网络
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/\".

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

精彩评论

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

关注公众号