Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
- Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed. - Maintenance fixes only
Considered feature-complete by its maintainers. - Module categories: Site Structure
- Created by bgilhome on , updated