This site is archived.

Field API and Fields in Core

bjaspan's picture
Submitted by bjaspan on Wed, 07/02/2008 - 16:45.

Session recording

Attached files

Placement
Session time: 
08/29/2008 - 11:00 - 08/29/2008 - 12:00
Conference booklet summary and bio
Article for conference booklet: 
The session will introduce the Field API intended for Drupal core. The Field API supports "CCK fields in core" as a new central concept for organizing content as an eventual replacement for the Node API model. Drupal's strategic advantage in the market (its "secret sauce") is an architecture that allows contributed modules to easily value­add content in the system. That design allows for very rapid development of new functionality, both of general use and of use specific to a single installation. The future of the web is interoperability and web services. Drupal's current architecture is ill­equipped at present to take advantage of that, as it is largely bound to a single, entirely local data workflow (nodes) that lives essentially in a vacuum. For Drupal to continue to lead the CMS/community plumbing market, it needs to refocus its data handling to seamlessly integrate both local and remote data and be able to mix and match the two. The Field API is an attempt to integrate an evolved, more robust CCK­like system into Drupal core. A Field is the basic unit of rich content (i.e., "e­mail address" and "comment", not "string" and "int"), be it local or remote, and Fields are organized into Nodes or Entities. The goal is to get away from the "giant blob of data" that is the current node object; it is not an acceptable way forward. This example shows how the current Field API can be used to create a new local data field called "summary" for a content type called "article": <?php // Create a field. $field = new TextField('summary'); field_create_field($field); // Create a field instance. $content_type = 'article'; $instance = new TextFieldInstance('summary', 'article', 'text_textarea'); $instance->widget->weight = 5; $instance->widget->label = t('Summary'); $instance->widget->description = t('A short summary of this article.'); $instance->widget->rows = 10; field_create_instance($instance); ?>
Bios for conference booklet: 
Barry is an entrepreneurially-minded computer programmer with a strong focus on computer security and privacy. Prior to Acquia, Barry spent two years as a Drupal core developer; he also created interMute, the first commercial web annoyance blocker, and Spamnix, a spam-blocking product. Barry is a maniacal whitewater kayaker and rock climber and generally spends his time wherever rocks, water, and gravity dance.

Overview

The session will introduce the Field API intended for Drupal core. The Field API supports "CCK fields in core" as a new central concept for organizing content as an eventual replacement for the Node API model.

Agenda

* Motivation for Fields in core
* Design goals for the Field API
* Current status of the Field API
* Fields on remote data and the semantic web

Goals

Attendees should leave this session understanding what the Field API is, how it will work, and how to use it to create custom content types programmatically.

Resources

Attendees should be familiar with node types and how to use CCK user interface to define custom content types with fields.