[development] D6 Programmatic creation of a custom content type with fields

jeff at ayendesigns.com jeff at ayendesigns.com
Mon Jan 17 03:49:26 UTC 2011


I find what seems to be two different approaches for creating fields for 
a custom content type via a module. One is from drewish, where the field 
is first added via cck manually, then dumped with 
var_export(content_fields()) and then added to the content type in the 
install via content_field_instance_create(). The other is in rfay's 
Example module, where Randy creates a table for the module in the 
install and inserts fields into it that are what cck would insert.

I'm wondering if the latter removes the need for me to do all the node 
processing from my module. Also, my content type has one field (other 
than title and body) which is an image filefield with unlimited 
instances, and I'm thinking that that same method would have the field 
being handled by filefield and that the method in Example would require 
that I manage the _fid, _list and _data db content, etc., so if there's 
a reason why this would be a better way to do it, or why the first 
method wouldn't be, I'm missing it.

Jeff
-- 

Ayen Designs
388 Bullsboro Drive #105 · Newnan, Georgia 30263
404-271-9734
Web:ayendesigns.com <http://ayendesigns.com>
Blog: theAccidentalCoder.com <http://theaccidentalcoder.com>
Drupal: j. ayen green <http://drupal.org/user/367108>
IRQ: j_ayen_green
IM (Yahoo) baalwww    (MSN) baalwww at yahoo.com
Skype: ayendesigns

Ayen Designs is a tradename of the computer services division of

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110116/218d0a9c/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ayenlogo
Type: image/jpeg
Size: 8316 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/development/attachments/20110116/218d0a9c/attachment.jpe 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: acmelogo
Type: image/jpeg
Size: 1462 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/development/attachments/20110116/218d0a9c/attachment-0001.jpe 


More information about the development mailing list