By half_brick on
I'm grappling with learning drupal and have made a custom node type of my own.
I now want to create a custom form for that node so that I can specify a relation between this node and another.
How can I go about creating another form for this module into which the user can put the other node name or select from a drop down list?
Basically, can you define futher forms and update actions past the CRUD ones with drupal, or are you stuck with the add/update form?
Cheers
Comments
Starting points
http://api.drupal.org/api/4.7/file/developer/topics/forms_api.html
http://api.drupal.org/api/4.7/file/developer/topics/forms_api_reference....
http://api.drupal.org/api/4.7/group/form
And have a look through the code of modules that do sorta similar stuff to see how they did it.
--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal
My issue is not so much with
My issue is not so much with the building of the form, but where to define the form within the module?
If I create a function to build the form, how will drupal know where to find it and to execute it?
thanks
It's all about the hooks
http://api.drupal.org/api/4.7/group/hooks
Modules are basically just a series of hook functions that get triggered by Drupal for various events.
eg for your own node type:
http://api.drupal.org/api/4.7/function/hook_form
or for adding your own stuff to other node types:
http://api.drupal.org/api/4.7/function/hook_nodeapi
--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal