by csixty4 · 13y ago · 0 comments
The code to create a node is simple. The code to create a node with a term reference, two field collections, and images copied from the filesystem is considerably more complicated, poorly documented, and prone to throwing weird errors.
If you're writing a module when you don't understand how modules work, you're gonna have a bad time. The Examples for Developers[1] module probably would have helped out. The Field example creates a custom field. The Node example create a custom node type. Or you could have just created the node type using the Field UI (and if you need it in code, export the configuration using Features[2]).