Example:
I have created new content type and added/customized field_mail, field_phone and field_city fields to it.

Is it possible to construct a form in my custom module smth like:

$form['phone'] = array(
  '#type' => 'field_phone',
);

so that all settings of the field_phone instance will be taken from cck?

Comments

yched’s picture

Maybe something like this

module_load_include('inc', 'content', 'includes/content.node_form');
$field = content_fields($field_name, $node_type_name);
$form += (array) content_field_form($form, $form_state, $field);

Not sure what will break and what will not, you'll need to test it :-)