cck
The node skeleton technique - combining the power of module and CCK based nodes
Nodes fall into 3 categories:
1. Generated via a module, no CCK fields
2. Generated by CCK only
3. Created via a module with CCK fields added
For L10 projects, the CCK should not be used to create new content types (node type 2 from above). In instances where you may be tempted to create a node wholly by the CCK, create a node skeleton module and enable it first, then use CCK to add fields. A node skeleton does not add its own table.
When using CCK, do we need to program in hook_load to load the data for the new fields
No, unless you need extra or custom data. The CCK automatically handles loading of data for the fields created via the CCK. In general the CCK does a good job loading its data, however there are times where you might want additional data that is not automatically loaded.
Drupal node module skeleton
Recipe for creating a node module skeleton:
1. Create three files using the code snippets at the bottom of this post
- foo.info
- foo.module
- foo.theme
Note: replace foo with your module name. If this is for a specific project, use project codes in the format [pc][nodetype]
2. do the following search and replace on all three files
"[pc]foo" -> [pc][nodetype]
"foo" -> [nodetype]
foo.info code:
; $Id $ name = "Foo" description = "Foo posts." package = dependencies =
foo.module code:
