Use a form submit hook to pass information down the form API and create a node programmatically.
Objectives and Prerequisites
You will need the following knowledge and skills. If you need a review, check out the Resources section at the bottom of this page.
- Create a form submit hook, and act upon values passed to it.
- Create a node programmatically.
For bonus points, on an existing node, you can check if the data from the external API is the same as is in the Drupal database and update the node programmatically if there are differences.
- Parameters in the form API, e.g.
hook_form_submitare passed by reference.
- Nodes can be created programmatically and the representation of nodes when we view them is very similar in structure to when we save them.