Can you please post the code to do such validations about other modules and field being exisiting already, so that I don have to re-invent the wheel.<div><br></div><div>Thanks..<br><div><br clear="all">--<br>Regards,<br>Nitin Kumar Gupta<br>

<a href="http://publicmind.in/blog/">http://publicmind.in/blog/</a><br>
<br><br><div class="gmail_quote">On Mon, Sep 21, 2009 at 11:50 PM, Emma Irwin <span dir="ltr">&lt;<a href="mailto:emma.irwin@gmail.com">emma.irwin@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

This has worked for me as well, and I haven&#39;t had any issues.  Testing with install/uninstall is important as is considering that that CCK field name might already exist.  <br><br><div class="gmail_quote"><div class="im">

On Mon, Sep 21, 2009 at 3:51 AM, nitin gupta <span dir="ltr">&lt;<a href="mailto:nitingupta.iitg@gmail.com" target="_blank">nitingupta.iitg@gmail.com</a>&gt;</span> wrote:<br>
</div><div><div></div><div class="h5"><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">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/" target="_blank">http://publicmind.in/blog/</a><br></div></div>
</blockquote></div></div></div><br>
</blockquote></div><br></div></div>