Pure Sign Breakfast Presentations - Drupal FieldAPI
Upcoming SlideShare
Loading in...5
×
 

Pure Sign Breakfast Presentations - Drupal FieldAPI

on

  • 1,125 views

Introduction to Drupal FieldAPI....

Introduction to Drupal FieldAPI.

Topics:
The different abstractions behind the FieldAPI.
The Drupal hooks needed to define your own custom Field.
The advantages of creating fields using the Drupal FieldAPI.

Statistics

Views

Total Views
1,125
Views on SlideShare
1,112
Embed Views
13

Actions

Likes
1
Downloads
5
Comments
0

2 Embeds 13

http://localhost 10
http://www.linkedin.com 3

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Pure Sign Breakfast Presentations - Drupal FieldAPI Pure Sign Breakfast Presentations - Drupal FieldAPI Presentation Transcript

  • toon@puresign.be Drupal FieldAPI @toonketels Pure Sign Breakfast Presentation 16/02/2012
  • Overview ‣ Entities ‣ Fields ‣ Anatomy of a field ‣ Creating a new fieldtype ‣ Why using the Field API ‣ Resources
  • Entities
  • Entities are the things, the data, the information, the “stuff”, that we want do deal with in our Drupal application. http://www.istos.it/comment/2882 Entities
  • Entities ‣ An abstraction for content ‣ Entities & bundles ‣ Created because not everything is a node ‣ What makes node powerful is their fieldability
  • Fields
  • The smallest data items we add to entities. Fields
  • Field type FieldField instance Layers of abstraction
  • Fields types ‣ Contains business logic of field ‣ Is conserned with: - What happens with data loaded from storage layer? - What should happen with data inputted by user to storage layer? ‣ Examples: - List - Text - Price - Link
  • Field types
  • Fields ‣ Data structure holding some settings ‣ A name and a type ‣ Link: field_website ‣ Some cannot be reverted, influence on db ‣ Settings apply everywhere field is used
  • Field
  • Field
  • Field
  • Field instance ‣ A field attached to a bundle ‣ Adds bundle specific settings ‣ bundle_fieldname
  • Field
  • Field
  • Anatomy of a Field
  • Field DisplayInput widget formatter Anatomy of a field
  • Creating a new fieldtype
  • 3 parts ‣ Defining a field ‣ Defining an input widget ‣ Defining a formatter
  • Field ‣ hook_field_info() ‣ hook_field_schema() ‣ hook_field_validate() ‣ hook_field_is_empty()
  • Widget ‣ hook_field_widget_info() ‣ hook_field_widget_form()
  • Formatter ‣ hook_field_formatter_info() ‣ hook_field_formatter_view()
  • Formatter
  • Code example
  • Why using the Field API
  • Why? ‣ It’s the way it goes...
  • Reusability ‣ Module: enable on any site ‣ We define a type ‣ Can be attached to any entity bundle ‣ User can customize it ‣ Create an instance
  • Pluggable ‣ Decouplingarchitecture ‣ Field data ‣ Input widget ‣ Display ‣ Other devs can ‣ Create input widgets ‣ Create formatters ‣ Alter (alter hooks)
  • Storage ‣ We don’t write sqlagnostic ‣ Data retrieval done for us ‣ Only implement schema ‣ Storage engine independent
  • Settings forfree ‣ Settings for free ‣ Required ‣ Help text ‣ Defaults ‣ Single - multiple - max
  • Settings for free
  • Single multiple, max number
  • Consistent UI build for us
  • UI ‣ Configure field ‣ Input widget ‣ Selection of formatter
  • Views integration
  • Viewsintegration ‣ Display field ‣ Multiple field settings ‣ Filter criteria ‣ compound_one ‣ compound_two ‣ delta ‣ Sort criteria ‣ compound_one ‣ compound_two ‣ delta
  • Features exportability
  • Display & DS ‣ Works with DS ‣ (better: DS works with fields)
  • Resources
  • Resources ‣ http://drupal.org/node/707832 ‣ http://api.drupal.org/api/drupal/ modules!field!field.module/group/ field/7 ‣ http://api.drupal.org/api/examples/ field_example %21field_example.module/7
  • toon@puresign.be @toonketels Questions?