20 APIs Every Drupal Developer Should Know--Notes

This session just went through 20 of the most used APIs in Drupal and described quicly what they can be used for. The presenter has also posted blog posts about some of these APIs in the month leading up to DrupalCon.


Hooks API

Allows you to write your modules so other modules can interact with them.
  • Provide info (like hook_help)
  • Alter data (like hook_form_alter)
  • React to events going on within the system (hook_node_save)

Theme System

  • Separate logic and data from presentation
  • Allows designers to override your interface
hook_theme_registry_alter

Forms API

Collects input from users, and automates data collection, validation, and submission. Can use AHAH or AJAX. Views uses FAPI innovatively.

Taxonomy

Allows your content to be sorted into categories. Geo Taxonomy module is a good example of innovative use of taxonomy.

Node API

Can react to operations taking place on a node. Good examples are book, poll, organic groups. Can define bulk operations with node_operations.

CCK

Can define your own field formatter

 

Views API

Expose module's database tables to Views. You can also use hook_views_plugin to query something besides the database.

 

Ctools

Collection of APIs. Exportables for exporting to another site. Plugins-can let people make plugins for your modules. Modal dialogs, pluggable content, CSS tools.

Token API

Allows you to replace strings of text wihtin a larger string Use hook_token_values to declare your own values

User Relationship API

Creates social links between users. hook_user_relationships. hook_user_relationship_type. Helps you build Facebook like relationships.

Activity API

[26:00] Keeps track of actions people take on your site. Provides feeds of tose activities. Provides access control. Integrates with OG to limit access

OG

hook_og_links_alter to add links to the default block
hook_og allows your module to react to people joining, leaving, etc
og_subscribe_user
og_save_subscription
og_delete_subscription
og_get_suscription
og_is_group_admin_
og_is_group_type

Services

[30:00} Allows external systems to integrate with Drupal. Modules can define their own kind of servers. API for defining Web Services.

 

Apache Solr

Provides enterprise level search capability. Easily index your content types. Allows you to sort by custom fields, create your own search facets. Creates custom search pages.

Feeds

Allows you to import and aggregate data. Most commonly used for RSS, but the API is a lot more powerful than that. You can define ways to fetch information, parse it, and process it. Parse that data into something the processor can understand. Already default processors for nodes, users, etc.

WYSIWYG

Plugs in various wysiwyg editors. Can be used on any form, not just content creation

Domain Access

Lets you serve multiple websites using one Drupal installation. Can get current domain from one global variable.

Triggers & Actions

Allows site administrators to trigger your code based on certain events that happen in the system, called triggers. [46:00]

Messaging and Notifications API

A framework that standardizes the way that messages are sent to users. API can be used to define new message types. Notifications is a framework for subscriptions.

Voting API

Helps you store, retrieve, tabulate and manipulate votes