Developing custom-built Field Types
“Why should I care about custom-built field types when Drupal already provides me the essentials?“
Often we store information in our nodes (or whatever entity) in terms of groups of data (for example, a street address, city, state, and postal code), however, the most commonly used strategy has been to create individual fields and “glue” them all together to make them appear as they are coherent. This is simply wrong!
There is a huge difference between grouping a series of textfields together and calling it a “thing”, and using say, the address field module. With simply configuring individual fields together, there is a cost of performance, complexity, and an overhead of maintaining a lot of custom code (both in the back and front-end.)
By the end of this presentation, you will know how to:
- Define new field types and build their schema
- Create configuration forms for fields and their instances
- Properly validate data going into your fields and define what “empty” means
- Provide “widget” forms to create meaningful UI’s
- Provide a layer of configurations to the widgets themselves
The last component of this talk involves the “presentation layer” and is discussed in the “Advanced Theming: Writing Field Formatters” presentation.