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
| Name | Description |
|---|---|
| Example: Action | Creating actions in Drupal 7 |
| Example: AJAX Graceful Degradation | These examples show AJAX with graceful degradation when Javascript is not available. |
| Example: AJAX | These examples show basic AJAX concepts. |
| Example: Batch API | Outlines how a module can use the Batch API. |
| Example: Block | Demonstrates code creation of blocks. |
| Example: Cache API | Outlines how a module can use the Cache API. |
| Example: Cron | Example using Cron API, including hook_cron() and hook_cron_queue_info(). |
| Example: Database (DBTNG) | Database examples, including DBTNG. |
| Example: Email | Example of how to use Drupal's mail API. |
| Example: Field Types API | Examples using Field Types API. |
| Example: Files | Examples demonstrating the Drupal File API (and Stream Wrappers). |
| Example: Filter | Demonstrates the creation of filters. |
| Example: Form API | Examples demonstrating the Drupal Form API. |
| Example: Image | Demonstrates the basic use of image API. |
| Example: JavaScript | Examples using Drupal 7's built-in JavaScript. |
| Example: Menu | Demonstrates uses of the Menu APIs in Drupal. |
| Example: NodeAPI | Example using NodeAPI. |
| Example: Node Access | Demonstrates node access. |
| Example: Node | Example defining a node type in code. |
| Example: Page | This example demonstrates how a module can display a page at a given URL. |
| Example: Queue | Demonstrating the Queue API |
| Example: Render | Demonstrate 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: Simpletest | An example of simpletest tests to accompany the tutorial at http://drupal.org/node/890654. |
| Example: Token API | Examples using the Token API. |
| Example: Trigger | Trigger definition example module. |
| Example: Vertical Tabs | Demonstrates the vertical tabs functionality provided by Drupal 7. |
| Example: XML-RPC | Demonstration of XML-RPC in Drupal 7. |
Functions & methods
| Name | Description |
|---|---|
| examples_help | Implements hook_help(). |
File
- ./
examples.module, line 14 - This file serves as a stub file for the many Examples modules in the Examples for Developers Project which you can download and experiment with.