I'm trying to write my own module, I've created some cck file, image fields , date, then I've created my own form,
How can I use these cck widgets in my custom form ?
thanks..

Comments

jaypan’s picture

You can't. CCK widgets are only for node forms.

Edit: or at least I'm 99% sure they are - maybe someone will come around and prove me wrong.

Contact me to contract me for D7 -> D10/11 migrations.

Eng_A_Moktar’s picture

actually my form is node form, I use it for inserting nodes, or updating nodes
is it still 'You can't' ?

jaypan’s picture

Is it a custom form that interacts with nodes, or is it the Drupal provided node form?

Contact me to contract me for D7 -> D10/11 migrations.

Eng_A_Moktar’s picture

Thanks for response,
it is a custom form that interacts with nodes.

jaypan’s picture

You can't.

Contact me to contract me for D7 -> D10/11 migrations.

benewu’s picture

I have custom form too and want to use CCK.
Does drupal7 solve this problem when CCK become the core module in drupal 7?

jaypan’s picture

No. CCK fields are still related to nodes in Drupal 7, though they have also extended that functionality to user profiles and taxonomy.

Contact me to contract me for D7 -> D10/11 migrations.

benewu’s picture

Hi Thanks Jay,

Does there have any way to use CCK feature in custom form or custom business table?
Such as I have a table name "book" and have some fields, could I use CCK feature to build the "book" form automatically?

jaypan’s picture

No. CCK is only for node forms.

Contact me to contract me for D7 -> D10/11 migrations.

benewu’s picture

CCK is great and it will be better that could support to develop custom form expect extend node.

benewu’s picture

CCK have many useful field now and the fields are useful for custom forms too.

jaypan’s picture

The form API does most of what CCK can do already. So CCK isn't really needed for extending custom forms.

Contact me to contract me for D7 -> D10/11 migrations.

Eng_A_Moktar’s picture

sure, but what if i want to use a date widget ?
file upload widget ?
can you help ?

jaypan’s picture

file upload: upload element module
date widget: date api module

Contact me to contract me for D7 -> D10/11 migrations.

DeeZone’s picture

To be clear, it's the "Date" module (http://drupal.org/project/date) that has the "date api".