Examples

  1. drupal
    1. 8
    2. 6
    3. 7

Well-documented API examples for a broad range of Drupal 7 core functionality.

Developers can learn how to use a particular API quickly by experimenting with the examples, and adapt them for their own use.

Download the Examples for Developers Project (and participate with submissions, bug reports, patches, and documentation) at http://drupal.org/project/examples

Groups

NameDescription
Example: ActionCreating actions in Drupal 7
Example: AJAX Graceful DegradationThese examples show AJAX with graceful degradation when Javascript is not available.
Example: AJAXThese examples show basic AJAX concepts.
Example: Batch APIOutlines how a module can use the Batch API.
Example: BlockDemonstrates code creation of blocks.
Example: Database (DBTNG)Database examples, including DBTNG.
Example: EmailExample of how to use Drupal's mail API.
Example: Field Types APIExamples using Field Types API.
Example: FilesExamples demonstrating the Drupal File API (and Stream Wrappers).
Example: FilterDemonstrates the creation of filters.
Example: Form APIExamples demonstrating the Drupal Form API.
Example: ImageDemonstrates the basic use of image API.
Example: JavaScriptExamples using Drupal 7's built-in JavaScript.
Example: MenuDemonstrates uses of the Menu APIs in Drupal.
Example: NodeAPIExample using NodeAPI.
Example: Node AccessDemonstrates node access.
Example: NodeExample defining a node type in code.
Example: PageThis example demonstrates how a module can display a page at a given URL.
Example: QueueDemonstrating the Queue API
Example: RenderDemonstrate how render arrays are arranged and how they can be altered. This alters blocks and the page to show the actual render array that is being used to create each item.
Example: SimpletestAn example of simpletest tests to accompany the tutorial at http://drupal.org/node/890654.
Example: Token APIExamples using the Token API.
Example: TriggerTrigger definition example module.
Example: Vertical TabsDemonstrates the vertical tabs functionality provided by Drupal 7.
Example: XML-RPCDemonstration of XML-RPC in Drupal 7.

Functions & methods

NameDescription
examples_helpImplements hook_help().

examples/examples.module, line 14