I had to use some hook functions on almost every project I worked, right now I am working on a project ( basically to collect donations and maintain organizations list ) where I need to write lots of custom code, at first I started to write all the code in theme i am developing, later I realized that its not going good with all the functions in theme because some hooks need to be written in modules so now some of the code is written in module and some is in theme which breaks the functionality when switch theme or with admin theme.

So I am thinking to write all the code again but not sure what is the best approach to write custom code in a drupal project.

if all code goes in custom module some of the theme sections needs to be rebuild and I didnt find any proper article on net on this

1 Answer 1


I think your question is more of in-general type . Please specify for what all purpose you need to use hooks . I think this might be helpful for you : http://www.stephanemartinw.com/articles/25-theme-drupal-hooks-templates-functions


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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