Override a theme function with a module
You cannot override a themename_ prefixed function in the theme itself. Nor a in the template, prefixed with phptemplate_
But for a function defined in a module only as theme_function_name, read on:
overwrite a theme function in a module
err, override a theme function in a module
No one answered him:
http://lists.drupal.org/pipermail/themes/2007-July/000633.html
Is there a way to override a theme function created by a module in another module?
I know how to override theme functions with a phpTemplate theme.
But I would like to do it from another module (that will be put in contrib).Is it possible?
thanks,
Augustin.
Using Theme Override Functions
http://drupal.org/node/55126
Well, it's not the best way, because you can't guarantee people are using phptemplate (although they really, really should be!) you can override from a module with phptemplate_name_of_theming_function()
Comments
Possible solution
Try to use hook_theme in your module declaration file.
For example if you implement the module test then u can override the theme by using inline_theme().
In this function you can return an array with the theme declaration like:
return array('test_test' => array('arguments' => array(...), 'file' => 'test.theme.inc'));
with test.theme.inc as the theme declaration.
For D6 it can be done properly
http://api.drupal.org/api/function/hook_theme_registry_alter/6
theme overriding in another module
this will help to override theme function in another module.
http://www.lullabot.com/articles/overriding-theme-functions-in-modules
Post new comment