This example demonstrates how to use node hooks.

This is an example demonstrating how a module can be used to extend existing content types. We will add the ability for each node to have a rating, a number from one to five. The rating will also be tracked using the revision system, so every revision may have different rating values.

Parent topics

File

modules/examples/node_hooks_example/node_hooks_example.module, line 7
Hook implementations for the Node Hooks Example module.

Functions

Namesort descending Location Description
node_hooks_example_config_info modules/examples/node_hooks_example/node_hooks_example.module Implements hook_config_info().
node_hooks_example_form_alter modules/examples/node_hooks_example/node_hooks_example.module Implements hook_form_alter().
node_hooks_example_node_delete modules/examples/node_hooks_example/node_hooks_example.module Implements hook_node_delete().
node_hooks_example_node_insert modules/examples/node_hooks_example/node_hooks_example.module Implements hook_node_insert().
node_hooks_example_node_load modules/examples/node_hooks_example/node_hooks_example.module Implements hook_node_load().
node_hooks_example_node_type_form_submit modules/examples/node_hooks_example/node_hooks_example.module A custom submit handler.
node_hooks_example_node_update modules/examples/node_hooks_example/node_hooks_example.module Implements hook_node_update().
node_hooks_example_node_validate modules/examples/node_hooks_example/node_hooks_example.module Implements hook_node_validate().
node_hooks_example_node_view modules/examples/node_hooks_example/node_hooks_example.module Implements hook_node_view().
node_hooks_example_theme modules/examples/node_hooks_example/node_hooks_example.module Implements hook_theme().
theme_node_hooks_example_rating modules/examples/node_hooks_example/node_hooks_example.module A custom theme function.