Overriding theme function in module for specific case
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. Thanks. Steve
Steve Edwards wrote:
embeds the ... form, I need to override the theme function for that form ... only when I'm embedding it How about using hook_form_alter to add an additional field that the theme function can recognize?
Nancy E. Wichmann, PMP Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
I did exactly that: $form['#theme'] = 'my_theme_function'; referring to the theme function in my module, but it doesn't take effect. Steve On Dec 9, 2009, at 2:17 PM, Nancy Wichmann wrote:
Steve Edwards wrote:
embeds the ... form, I need to override the theme function for that form ... only when I'm embedding it How about using hook_form_alter to add an additional field that the theme function can recognize?
Nancy E. Wichmann, PMP Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
participants (2)
-
Nancy Wichmann -
Steve Edwards