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[&#39;field_name&#39;] = &#39;myfield&#39;; </div><div>$field[&#39;type_name&#39;] = &#39;story&#39;; </div>

<div>$field[&#39;type&#39;] = &#39;filefield&#39;; </div><div>$field[&#39;widget_type&#39;] = &#39;imagefield_widget&#39;; </div><div>module_load_include(&#39;inc&#39;, &#39;content&#39;, &#39;includes/content.crud&#39;); </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>