1

Currently, I am using hook_page_alter() in my module, but this runs too early. I am loading some fields from the node in template.php so that I can put them into other regions. These fields need JavaScript code from my module, after they are loaded, as the JavaScript depends on the IDs which are generated during the field loading process.

If anyone can help or point me to a list of hooks ordered by the point at which they are run then that would be a great help.

0

1 Answer 1

2

template_preprocess_field() hook is your friend.

The general flow is:

theme($hook, $var) >> preprocess functions >> process functions >> finally either goto template.php or call theme function >> return output as string

therefore, template.php or theme function call is the final destination, no hook runs after template.php

2
  • That is absolutely perfect tyvm!
    – James
    Commented Nov 10, 2012 at 20:48
  • 1
    Actually, or the theme function is executed, or the template file is included (e.g. page.tpl.php). The template.php file is something different.
    – avpaderno
    Commented Nov 10, 2012 at 21:27

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.