Pacific Northwest Drupal Summit 2012

All the drops gather here.
Seattle, October 20-21, 2012

Have a field day with fields

Speaker(s): 
Track: 
Development and Code
Experience Level: 
Intermediate
Advanced

Trying to figure out how to extract data from fields so that it can be manipulated or displayed in ways other than the default method can be frustrating. The result is often complex logic and code in the theming layer and consequently, the proliferation of template files. This is almost never the correct way to solve the problem, since it's usually not technically a theming issue.

This session will be focused largely on writing custom modules. Hooks will be implemented, so an understanding of at least the basics of PHP programming will be useful.

The following topics will be discussed:

  • Taking advantage of contributed field modules
  • Creating custom field formatters or altering existing ones
  • Extracting, manipulating, and rendering field data the proper way
  • Populating extra fields on page load

Comments

Submitted by rlhawk on

I've added some additional comments to "Slides (With Notes)" concerning how to pass in extra options, such as a formatter, to field_vew_field and field_view_value. Also, in the presentation I said that employing field_get_items and field_view_value won't return a render array, which is not correct. field_get_items doesn’t return a render array, but field_view_value returns a very basic one.