I'm building a module (my_module) in Drupal 7. It has some functionality and also will create a new content type. In my_module.install, I implemented hook_install() (my_module_install()).

Can I use more hook_install() to create a new content type (my_module_install()) in this module? If the answer is yes, how should I do this? Otherwise, should I do this in another module?

1 Answer 1


If I were you, I would consider using the Features module. The module enables exporting a subset of websites structure into a single feature to facilitate re-using this feature elsewhere.

Also, Features module enabled exporting content types/fields easily, you would just tick a certain content type and Voila! The Features module will generate Drupal hooks for you, and also export the code into a module.

  • Thank You! I'm not sure I'll use Features module now, but it helped me understand how to create my content type.
    – alsator
    Nov 14, 2011 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.