How can i add to my custom form api in my custom module the default widget from field_image? I am using imagefield_crop module widget and it works in node/add form, but i cannot replicate it in my custom form api.


Problem is, Field API and Form API are separate things. You can add form elements to custom forms created with Form API, and you can add fields to custom entities created with Field API, but you can't really cross the border. Well, you can wrap form element into a field, but not the other way around.

| improve this answer | |
  • 1
    Definitely true of core, but with a little sprinkle of ctools you can pull it off. It's not pretty but it works – Clive Jun 29 '13 at 23:35

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