I've been using Drupal now for a pretty long time, but this whole hooks and preprocessor thing still gets me confused. And I can't seem to really find a structured documentation to help.
Intuitively it feels like changing a contrib module is not part of theming, but more of module extending / modifying, but it is also theme-specific, so it's confusing to know if this topic is indeed related to the above or not.
Here are some of my questions that I am still left with:
1. are function hooks used in modules the same as theme hooks used in the theme?
2. if a contrib module uses a "hook" is this something i can override or extend in my theme?
*3. if a contrib module uses a hook, say: hook_block() can I then hook the hook to change the module's output?*
example: inside the contribmodule.module file:
contribmodule_block() { $variables['foobar_item'] = 'foobar item'; }
can this be overriden by the following in the template.php file?
contribmodule_preprocess_block() { $variables['foobar_item'] = 'new item'; }
Is there a guide for all the fundamental concepts? All i can find is the API for hooks, but that says really nothing at all about it other than giving a list of available hooks; zero theory there.
4. if a contrib module has a function which I can NOT override with a hook onto a hook, then how do i change what the contrib module does for my theme? am I forced to hack the code of the contrib module?