This page is archived
We're keeping this page up as a courtesy to folks who may need to refer to old instructions. We don't plan to update this page.
Check and create taxonomy terms programmatically.
In a custom module, create taxonomy terms and relate them to a node.
You will need the following knowledge and skills. If you need a review, check out the Additional resources section at the bottom of this page.
- Create taxonomy terms programmatically.
- Associate taxonomy terms with a node programmatically.
Write conditional logic to meet the following requirements:
- If a taxonomy term already exists, get the term ID.
- If the taxonomy term does not exist, create it and return the term ID.
- Taxonomy terms can be created programmatically.
- Terms are associated with nodes via a term ID.
Further your understanding
- Continue to the next lesson: Movie Project: Import Data in a Site Update.
- API Documentation: Taxonomy functions (api.drupal.org)