Why Drupal module developers should be excited about object-oriented hooks
- Read more about Why Drupal module developers should be excited about object-oriented hooks
- 5 comments
- Add new comment
A friend recently came to me with the following question:
I have a site that has a mode optimized for low-bandwidth use. Can I change the number of rows returned by a view based on the theme?
The Views 2 API has a function called hook_views_query_alter() which allows you to modify the View object before it pulls the results from the database.
In order to use views hooks, you must create a module that registers itself as using the Views API:
If your client is being very picky about the titles of certain pages, especially views, you may find yourself needing to write some code to set the title at the theme level. This is normally fine, since Drupal 6 has some great hooks, like hook_preprocess_page() and its cousins for blocks, nodes, and user profiles.