I have a handful of modules written for 5.x and updated, with the help of the Coder module, to be compatible with 6.x (in addition to reading the documentation for upgrading modules 5.x -> 6.x, such that I have implemented module_theme() to declare what themes it registers, etc. and verified this by looking at the theme registry.
Alas, regardless of what I put in the #theme key for the node creation form, it appears that the function I specify as the handler for the theme is never called. This is bizarre and different from the 5.x behavior, even accounting for the new module_theme() system of registering theme calls.
It's in the registry.
It's specified for the node creation form.
It's in the form as it's passed around between hooks.
But for whatever reason, the Drupal 6.x Form API does not seem to act upon #theme.
Is this method of themeing forms deprecated? What is the preferred method in that case?
Thank you for the favor of a reply,
--tim
Comments
Comment #1
timtriche commentedIt turns out that, by inspecting the arrays returned during form processing, I was able to find out that the default theme for a node form in a module is module_node_form (actually it is pushed onto the front of an array of themes, [0] => module_node_form, [1] => node_form ).
This doesn't match the form themeing documentation, and since someone helped me with it (though I also found it on my own), I thought I could save others the trouble and update the forms API reference or Quickstart guide.
How do I get involved with updating documentation?
thank you,
--tim
Comment #2
pluess commentedYou have to register your theming function with hook_theme to make it working.
Example:
Comment #3
dave reid@tim, The node form theme function is actually nodetype_node_form and not module_node_form.