[development] Overriding theme function in module for specific case

Steve Edwards killshot91 at comcast.net
Wed Dec 9 20:23:33 UTC 2009

I have a module called feature_package.module that embeds the 
nodequeue_arrange_subqueue_form, and I need to override the theme 
function for that form (theme_nodeuqueue_arrange_subqueue_form) only 
when I'm embedding it (i.e. I don't want to override the theme function 
when the form is being displayed in the admin area).  I would also like 
to do it in the module, and not template.php.  so my questions are, how 
would I implement the function and hook_theme in my module?  I've been 
playing around with various combinations of hook_theme values and 
function names and haven't been able to get the theme function to be 
used for the form.  For example:

function feature_package_theme() { 
  return array(
    'nodequeue_arrange_subqueue_form' => array(
      'arguments' => array('form' => NULL),
      'function' => 'feature_package_nodequeue_arrange_subqueue_form',

I can see my changes taking place in the theme_registry (by using dsm() 
inside hook_theme_registry_alter) after clearing cache, so I know that's 
not the issue.



More information about the development mailing list