The D6 node_example in Examples is the non-CCK technique, and it adds *data* but not fields, to a node. Presentation and data management are done in custom code.<br><br>If you just need something that CCK can do, use features and CCK (which is essentially the easier way to do #1). <br>
<br>Both ways work, but if you *can* do it with CCK + features I would think that would be the best technique.<br><br>-Randy<br><br><div class="gmail_quote">On Mon, Jan 17, 2011 at 4:49 AM, <span dir="ltr"><<a href="mailto:jeff@ayendesigns.com">jeff@ayendesigns.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="direction: ltr;" text="#000000" bgcolor="#ffffff">
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.<br>
<br>
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.<br>
<br>
Jeff<br>
<div>-- <br>
<p style="margin-bottom: 0in;"><img src="https://mail.google.com/mail/?ui=2&ik=584c5da64d&view=att&th=12d9217c10bab20f&attid=0.1.1&disp=emb&zw" name="ayenlogo" valign="top" align="LEFT" border="0" vspace="30">
<font style="font-size: 8pt;" size="1">Ayen Designs </font><font face="Times New Roman, serif"><font style="font-size: 8pt;" size="1">
<br>
388 Bullsboro Drive #105 · Newnan, Georgia 30263</font></font>
<br>
<font face="Times New Roman, serif"><font style="font-size: 8pt;" size="1">
404-271-9734<br>
Web:<a href="http://ayendesigns.com" target="_blank">ayendesigns.com</a><br>
Blog: <a href="http://theaccidentalcoder.com" target="_blank">theAccidentalCoder.com</a><br>
Drupal: <a href="http://drupal.org/user/367108" target="_blank">j. ayen
green</a><br>
IRQ: j_ayen_green<br>
IM (Yahoo) baalwww (MSN) <a href="mailto:baalwww@yahoo.com" target="_blank">baalwww@yahoo.com</a><br>
Skype: ayendesigns
<br>
<br>
Ayen Designs is a tradename of the computer services
division of <img src="https://mail.google.com/mail/?ui=2&ik=584c5da64d&view=att&th=12d9217c10bab20f&attid=0.1.2&disp=emb&zw" name="acmelogo" align="absmiddle"></font></font></p>
</div>
</div>
</blockquote></div><br><br clear="all"><br>-- <br>Randy Fay<br>Drupal Module and Site Development<br><a href="mailto:randy@randyfay.com">randy@randyfay.com</a><br>+1 970.462.7450<br><br>