Experimental project

This is a sandbox project, which contains experimental code for developer use only.

With this module you can write custom-built Field definitions from within a extendable plugin system.

Currently, if you wanted something like the image field to have a few extra bits of information, you would have to literally copy all of the Image module's field hooks and add in your extra functionality on top of it in your own module. However, if the Image module's field definition was written with the field fairy, all you would have to do is write a class that extends it and override the methods (which replace most field hooks) that do what you wanted. All without having to copy+paste any bit of code.

Need to write several reference-like fields for your custom entities? Just write a base field definition as a field fairy plugin, and then override the methods that define what an "artwork reference" field really means, or whatever.

This module works as-is, however the code is really just a proof-of-concept. API and implementation needs major rework.

There are a few practical reasons explaining why I wrote this module:

  1. Writing a module for each field type sucks; likewise, writing a bunch of switch statements in hooks to have multiple field types in a single module sucks even more.
  2. "Extending" an existing field doesn't really exist beyond alter hooks, and that isn't maintainable in a large system.
  3. Usually custom Field types are for feature-specific use-cases, and "features" that depend on them would require those fields to come from published Drupal projects (I guess unless a make file grabs it from a different source), although the field module wouldn't really make sense to be a stand-alone module. Also, see point 1.

Project information