Drupal module node type creation .install vs .module -
after browsing net on hour question remains. 'correct' way create node type in module.
.install: hook_install() gives possibility create node_types using node_type_save() hook...
.module using hook_node_info() can add node type(s).
what pro's , cons of 2 methods? there in fact different? happens when uninstall module? how should 1 manage updates in both cases? drupal docu hasn't been helpfull me :(
you can create node_types using both node_type_save()
, hook_node_info()
.
drupal core book module creates in hook_install. more common practice in hook_node_info() or hook_entity_info() ( node module uses hook_entity_info() ).
if implement using hook_node_info() more complaint way drupal works. example node_type_rebuild() work values defined in hook_node_info()
, not node_type_save()
.
imo should using hook_node_info() or hook_entity_info() , let drupal core handle rest.
Comments
Post a Comment