开发者

Drupal 6 How to override theme function defined in module?

I'm using Taxonomy Browser Module and I'm trying to override the following theme function theme_taxonomy_browser_page which is in taxonomy_browser.module. So I wrote the following function in template.php:

function mytheme_taxonomy_browser_page($form) {
    return "Inside";
}

However, it isn't replacing anything with "Inside" on the page. What could I be doing wrong?

I have cleared cache. Please help me开发者_开发百科.


Which cache have you cleared?

Theme cache is a bit separated, try to submit the theme selections form at /admin/build/themes.


Might be a silly point but it helpss me make sure my code is being called... try using

drupal_set_message('inside');

It often helps me track down typos or misunderstanding of what is going on in my own admittedly limited Drupal development.


Just an observation in case somebody has the same issue as I had: If the theme you're going to override is going to be used for an administration menu you might be in for a surprise to discover that you have an additional template.php file. I had a sub-theme of Zen as the site theme, but I was using Garland for the administration menu which comes with it's own template.php file. Needless to say I tried for hours to override in the Zen sub-theme template.php file with no success.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜