0

I am a newbie into Drupal.

what else other than module name can replace 'hook' from any hook function in Drupal?
For ex. "myModule" replaces hook in hook_form_alter and defined as 'myModule_form_alter'

closed as unclear what you're asking by kiamlaluno Jul 18 '15 at 21:52

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • I updated my answer – M a m a D Jun 25 '15 at 6:08
0

If you are particularly looking at theme hooks following from https://www.packtpub.com/books/content/drupal-7-module-development-drupals-theme-layer can be useful.

All preprocess functions run before all process functions template_ prefixed functions run frst. [module]_ prefixed functions run next. [theme]_ prefixed functions run last Multi-hook functions run before hook-specific functions This results in the following order of execution for a particular theme hook:

template_preprocess()

template_preprocesss_HOOK()

MODULE_preprocess()

THEME_preprocess()

THEME_preprocess_HOOK()

template_process()

template_processs_HOOK()

MODULE_process()

MODULE_process_HOOK()

THEME_process()

THEME_process_HOOK()

1

Any alter hook and preprocess hooks that is defined inside a module can also be defined inside the theme as well. So if you are using Bartik theme you can open the Bartik's template.php file and use

function bartik_form_alter(){}

UPDATE

Checking the Is it possible to define hook functions in template.php instead of the module? can also be helpful.

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