Between them the hooks documentation pages and the node_example.module pages (http://api.drupal.org/api/file/developer/examples/node_example.module/5) are unclear about how to create a new content type in a custom module.
The node_example.module has too many hooks and is too rich an example. It should be clear what the bare minimum is, aside from any fancy fields. (It appear the minimum is hook_node_info() and hook_form.)
Meanwhile, the page for hook_node_info should say what other hooks need to be implemented.
Comments
Comment #1
aj045 commentedI thought the example provided here: http://drupal.org/node/132845 showed the minimum? Admittedly that example is a bit long and clunky. May need updating but I always fall back to that page if I need a refresher on custom node creation.
Comment #2
joachim commentedAs I make it, you can lose:
# hook_perm()
# hook_access()
It does go on a bit... :)
The stuff on making an info file could be cut, for instance.
Maybe the example on API could point to this handbook page?
Comment #3
aj045 commentedUpdating the API would be a patch, I would imagine.
Comment #4
betz commentedChanged the component to reflect the new component categorization. See http://drupal.org/node/301443
Comment #5
Bojhan commentedSeems somewhat wierd to still mark this as a bug of Drupal 7, now that fields have gone in
Comment #6
joachim commentedThere are still modules that define node types in code.
Comment #7
jhodgdonExample modules are now in a different project, so I'm moving this issue to that queue, for further discussion.
Comment #8
rfayI'm going to mark this fixed. The new #508342: D7 Node example demonstrating fields node example module is updated for D7.
Reopen if you like.