I've got a site working using the story content type, and the client would like one additional field added. Now in Drupal 4.7 my understanding was that I would need to create a new node type based on story. Either in a module or using CCK. However in Drupal 5.0 the Story description in Content Types indicates that modules can add fields to the story type.

To add to the confusion there's no more story.module or stories table. I've been trying to find documentation about this, but everything I turn up seems to be about Drupal 4.7. I even have the Pro Drupal Dev book and no mention that I can find of this.

I'm guessing I need add a DB table and add a couple hooks to my module (I've already got a theme and module developed for this project), so I'm just looking for the appropriate reference material. Any hints?

Comments

nevets’s picture

With Drupal 5 using CCK you can not only create new content type but also add new fields to existing content types (including story and page).

dasil003’s picture

Thanks for the response. I've used CCK before (pre 5.0) and felt that it added more overhead than defining node types in a module (I'm a programmer, so I don't have a lot of difficulty with the code).

In this case I'm adding a single field. So I'm thinking I can make my necessary changes by hook_nodeapi and formapi, along with the tweak to node.tpl.php to display the new field. Any thoughts on whether that would be harder/slower than installing and using CCK?

nevets’s picture

Run time speed is another issue and I am not sure of the answer. I recently did a site (low volumn) where I wanted a blog with extra fields and used CCK plus contemplate for theming, real quick and meets my need. Nothing fancy but you can see the results at http://act5.nevetssoftware.com (look under training).

Realistically you are normally only going to be showing a fairly small number of these nodes at one time and any speed difference is likely to be minimal.