[development] No module-defined node types?

Morbus Iff morbus at disobey.com
Thu Jan 4 17:33:43 UTC 2007


> CCK may be regarded as the greatest thing since sliced bread by users,
> site admins and even many developers, but I may not want to use CCK to
> define nodes when I've got some special data I want to use efficiently
> as content in a module I'm writing.  CCK is inefficient *by design* in
> order to purchase its flexibility.

You're missing it ;)

Consider Case Tracker. A "case" is really a title, a body, and then some 
case metadata, like status and priority and so on and so forth. The 
parts that make Case Tracker unique are not necessarily it's field 
types, but what HAPPENS to those field types programatically.

Anyone can make a title, and a body, and a dropdown field in CCK or in 
anything forthcoming for Drupal 6.x. What makes your module unique is 
its handling of those field types, and THAT's what modules will be doing 
in the future. Instead of defining a complete node type, they will 
instead be defining fields (be it a simple text field or a dropdowns or 
whatever) that are then "value-added" to any existing node type. You 
will still have your special data, but instead of listening on node type 
APIs like hook_insert or _update, you'll be listening on nodeapi 
functions like nodeapi $op 'insert' and 'update'.

So, when I ship Case Tracker, what I'm really shipping is logic, not 
data or node types. My logic says that, regardless of the data, whenever 
anyone uses my "status field" (that has been value-added to any existing 
node type) that /means/ something, and my module and custom code will do 
special things to that field upon request.

See also http://drupal.org/node/105808.

-- 
Morbus Iff ( and i twirled my hair and i popped my gum )
Technical: http://www.oreillynet.com/pub/au/779
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus


More information about the development mailing list