This project is not covered by Drupal’s security advisory policy.

This module is a container for functions that extend Drupal's core Field API. It could be installed as a library and it would work just as well.

Currently it provides functions assisting with:

  • Setting field items (prior to saving an entity)
  • Programmatically adding different types of fields

Specifically, it provides the following functions:

  • Set field items analog to field_get_items(), fieldhelp_field_set_items($entity, $field_name, $items)
  • Set field items for a single value given an array of single values, fieldhelp_field_set_single_value_items($entity, $field_name, $values, $index = 'value')
  • Set a single normal item, fieldhelp_field_set_item($entity, $field_name, $value)
  • Get a single item, fieldhelp_field_get_item($entity, $field_name, $entity_type = 'node')
  • Get a single item's value, fieldhelp_field_get_item_value($entity, $field_name, $index = 'value')
  • Create a field, fieldhelp_create_field($field_name, $type, $cardinality = 1, $translatable = FALSE, $locked = FALSE, $settings = array(), $entity_types = array(), $indexes = array(), $storage = array())
  • Create a field instance, fieldhelp_create_instance($field_name, $bundle, $entity_type = 'node', $label = NULL, $description = '', $required = FALSE, $default_value_function = '', $settings = array(), $widget = array(), $display = array(), $instance_additional = array())
  • Sets the instance' label, fieldhelp_instance_set_label(&$instance, $label) and similar for required and description.
  • Helpers to create text, textarea, integer, taxonomy, userreference, date, link, file, and image fields and field instances.
  • Set displays for a given view mode.
  • And more!

Created and presently developed by Stefan Freudenberg and Benjamin Melançon of Agaric.


Project information

Releases