By Hamid.D on
Hi all.
Is there any way to use cck fields in forms?
for example:
$form('item')=array(
'#type'=>'a ckk filed'
...
)
Hi all.
Is there any way to use cck fields in forms?
for example:
$form('item')=array(
'#type'=>'a ckk filed'
...
)
Comments
Hi there, I spent some time
Hi there,
I spent some time in recent months trying to answer that question for myself and, the short answer (and I would be thrilled to be wrong here) is 'no' you cannot define a CCK field in hook form. If you look at CCK fields they have a set of unique configuration for each, and are nto part of the form API:
http://api.drupal.org/api/file/developer/topics/forms_api_reference.html
You can use Content Type Export to copy a set of CCK field definitions, and import them either through Content Type Import, or programatically on Module install (which is what I did) based on some information I found here: http://drewish.com/node/118 using content_field_instance_create($field);
Again, I am hoping there is an easier way, but I haven't found it.
Thank you. I'm going to test
Thank you.
I'm going to test it!