Example using NodeAPI.

This is an example demonstrating how a module can be used to extend existing node types.

We will add the ability for each node to have a "rating," which will be a number from one to five. The rating will be tracked using the revision system also, so every node revision may have different rating values.

See also

Node API Hooks

Parent topics

File

modules/examples/nodeapi_example/nodeapi_example.module, line 8
Module implementation for nodeapi_example module.

Functions

Namesort ascending Location Description
theme_nodeapi_example_rating modules/examples/nodeapi_example/nodeapi_example.module A custom theme function.
nodeapi_example_theme modules/examples/nodeapi_example/nodeapi_example.module Implements hook_theme().
nodeapi_example_schema modules/examples/nodeapi_example/nodeapi_example.install Implements hook_schema().
nodeapi_example_node_view modules/examples/nodeapi_example/nodeapi_example.module Implements hook_node_view().
nodeapi_example_node_validate modules/examples/nodeapi_example/nodeapi_example.module Implements hook_node_validate().
nodeapi_example_node_update modules/examples/nodeapi_example/nodeapi_example.module Implements hook_node_update().
nodeapi_example_node_type_form_submit modules/examples/nodeapi_example/nodeapi_example.module A custom submit handler.
nodeapi_example_node_load modules/examples/nodeapi_example/nodeapi_example.module Implements hook_node_load().
nodeapi_example_node_insert modules/examples/nodeapi_example/nodeapi_example.module Implements hook_node_insert().
nodeapi_example_node_delete modules/examples/nodeapi_example/nodeapi_example.module Implements hook_node_delete().
nodeapi_example_install modules/examples/nodeapi_example/nodeapi_example.install Implements hook_install().
nodeapi_example_form_alter modules/examples/nodeapi_example/nodeapi_example.module Implements hook_form_alter().
nodeapi_example_config_info modules/examples/nodeapi_example/nodeapi_example.module Implements hook_config_info().

Classes

Namesort ascending Location Description
NodeApiExampleTestCase modules/examples/nodeapi_example/nodeapi_example.test Functional tests for the NodeAPI Example module.