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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -