Experimental project

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

Provides a Form API element type 'entity_field' for getting / setting a field from an entity.

eg. given a page $node, with field 'field_foo':

$form['title'] = array(
  '#type' => 'entity_field',
  '#settings' => array(
      'field_names' => array('field_foo'),
      'entity' => $node,
    ),
);

will attach to $form the rendered field widget for the field_foo instance attached to page nodes.

Additionally, the field can be rendered with an empty value to create an entity on submit:

$form['title'] = array(
  '#type' => 'entity_field',
  '#settings' => array(
      'entity_type' => 'node',
      'bundle' => 'page',
      'field_names' => array('field_foo'),
    ),
);
Supporting organizations: 

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • Module categories: Site Structure
  • Created by bgilhome on , updated