Where can I a list of available (in the core) fields and widgets and their names so I can reference them when adding fields to my own node-type definitions ?


To get a list of all field definitions use field_info_fields()

Returns all field definitions.

Use of this function should be avoided when possible, since it loads and statically caches a potentially large array of information. Use field_info_field_map() instead.

You can ignore the second paragraph of that as field_info_field_map() hasn't actually been included in a Drupal release yet.

For widgets use field_info_widget_types()

Returns information about field widgets from hook_field_widget_info().

  • Thank you - that also gave further insight into how to work with drupal APIs. ( Also , in fact I was interested in field-types, which I got through field_info_field_types() ) – mfit Mar 27 '13 at 14:44
  • Ah gotcha :) You might be interested in the field.info.inc file as a whole if you haven't already come across it – Clive Mar 27 '13 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.