One more thing, I haven't checked this out yet, but how do you delete the field that's created or update it?<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:58 PM, nitin gupta <span dir="ltr"><<a href="mailto:nitingupta.iitg@gmail.com">nitingupta.iitg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
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><div class="im"><br clear="all">--<br>
Regards,<br>Nitin Kumar Gupta<br>
<a href="http://publicmind.in/blog/" target="_blank">http://publicmind.in/blog/</a><br>
<br><br></div><div><div></div><div class="h5"><div class="gmail_quote">On Mon, Sep 21, 2009 at 11:50 PM, Emma Irwin <span dir="ltr"><<a href="mailto:emma.irwin@gmail.com" target="_blank">emma.irwin@gmail.com</a>></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'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>
On Mon, Sep 21, 2009 at 3:51 AM, nitin gupta <span dir="ltr"><<a href="mailto:nitingupta.iitg@gmail.com" target="_blank">nitingupta.iitg@gmail.com</a>></span> wrote:<br>
</div><div><div></div><div><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['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/" target="_blank">http://publicmind.in/blog/</a><br></div></div>
</blockquote></div></div></div><br>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>