Hi,<div><br>I wanted to add an imagefield to a content type, using the function content_field_instance_create(). I wrote this piece of code.<div><br>$field['field_name'] = 'myfield'; </div><div>$field['type_name'] = 'story'; </div>
<div>$field['type'] = 'filefield'; </div><div>$field['widget_type'] = 'imagefield_widget'; </div><div>module_load_include('inc', 'content', 'includes/content.crud'); </div>
<div>content_field_instance_create($field);</div><div><br></div><div>This works perfectly fine with me, and an imagefield gets added to the content type. are there any pitfalls in this i should take care of? or is there any better way to do such a thing?</div>
<div><br></div><div>Thanks,</div><div><br>--<br>Regards,<br>Nitin Kumar Gupta<br><a href="http://publicmind.in/blog/">http://publicmind.in/blog/</a><br></div></div>