The following hooks are frequently used by module developers.
Hooks |
Description |
---|---|
|
Create Views arguments array, including name, help text, handler code, and options |
|
Create default Views (See Chapter 2, and Appendix A). |
|
Create array of style plug-ins. These style plug-ins populate the View Type selection list in the Views UI. (See also Chapter 4, and Appendix C.) |
|
Create tables objects for use by Views The most common Views hook. See http://drupal.org/handbook/modules/views/apifor more information. Be sure to read Parts 1 to 5. |
The following hooks tend to be less well-known and not used as often:
Hooks |
Description |
---|---|
|
Allow modules to alter the arguments supplied others See http://drupal.org/node/105620 for more information |
|
Alter Views feed argument Sample use-case at http://drupal.org/node/333039. Also used by the Existing Nodes Filter module, at http://drupal.org/project/existingnodesfilter |
|
Alter the output string after the view is rendered. Used by Views' own views_rss module, and by the Calendar module. |
|
Alter returned data before it is rendered. Sample use-cases in the Calendar module, and at http://www.onetomany.com/adding_node_counts_view_titles_views_1x. |
|
Alter or extend the view query. Used by the i18n and Drupal For Firebug modules. |
|
Run-time query replacement. Used by a new module called Views Menu Nodes, http://drupal.org/project/views_menu_nodes. |
|
Alter views table values. Sample use case for this little-known hook at http://drupalhigh.onsugar.com/2669697. |
|
Array of tabs. Used by the Calendar module |
|
Add new theme wizard types. Used, naturally, by the Views Theme Wizard module, but like all of these hooks, available for use by other modules, as well. |
This table displays relevant hooks from other modules:
Hooks |
Description |
---|---|
|
In the Views UI, formatters created by this hook display as a drop-down list of Field Options. (See Appendix B.) |
|
Provide information on how to join the node tables from other modules. (See Recipe 55.) |