You are hereBlogs / Jeff Schuler's blog / A Paradigm for Reusable Drupal Features (DrupalCon 2009 notes)
A Paradigm for Reusable Drupal Features (DrupalCon 2009 notes)
A Paradigm for Reusable Drupal Features
Young Hahn, Robert Soden, Ian Ward (DevelopmentSeed)
- In theory: the problem + solution
- In practice: feature building demo
- The future: what comes next
A blog is a "feature". So is a pressroom, an image gallery, a publication library, etc., etc. Blog can be created using core module, or cusotm recreated.
Example: making a pressroom: content types, fields, views, etc.
3 problems: slow, not reusable, disconnected pieces
A (turnkey)feature module: takes everything usually done in UI and puts it into code. How?
- Scripted: content type, fields, taxonomy, menus
- Exported: imagecache presets, block visibility, block views, page views, comp. relations
Code:
- is reusable
- is distributable
- can be kept under version control
Getting site-building into code:
Scripts:
- pain to debug
- pain to maintain
- not easily extensible
Earl Miles' Chaos tool suite
Exportables:
- abstract data storage so that your module can be indifferent to whether it's in code or db
- provide definitions, not scripts
- are easy to maintain
- are overridable and extensible
Modules with exportables?
- views
- panels
- context_ui
- imagecache
Recipe for exportables
- string identifiers
- API functions for collecting all items
- Structured array or object to represent your item
Future: ability to export features into module form
Developers: move toward adding exportability into your module!
- Jeff Schuler's blog
- Login or register to post comments




