Let say we have theme function in module A theme_super_a(), this function returning some HTML. I want to write function in my own module (let's call it B) where I can get output of theme_super_a() manipulate it and return back to Drupal theme system. How can I do it?

Notice that I'm not interested in overriding whole theme with hook_theme_registry_alter(&$theme_registry).

  • 1
    If you're not willing to use the function provided for doing EXACTLY what you want to do, then you're not going to achieve your goal.
    – Chapabu
    Commented Feb 20, 2013 at 10:19

1 Answer 1


You will need to override the whole theme function in your own module. Because the override is done from a module level, not the theme, you will probably need hook_theme_registry_alter to change the theme function settings for that specific hook_theme component.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.