how i can add CCK fields to node type creation in my custom node?

adding field data for example with some settings...?

function reportage_node_info() {
// We return an array since a module can define multiple node types.
// We're only defining one node type, type 'reportage'.

return array(
'reportage_image' => array(
'name' => t('Reportage image'), // Required.
'module' => 'reportage', // Required.
'description' => t('Add images to reportage.'), // Required.
'has_title' => TRUE,
'title_label' => t('Titolo reportage'),
'has_body' => TRUE,
'body_label' => t('Descrizione reportage'),
'min_word_count' => 0,
'locked' => TRUE,
....

???

Comments

aaron1234nz’s picture

If your using CCK then you are best to use the User interface. Administer->Content->Content types->manage fields

If you are creating a content type from scratch (ie with PHP) then check out http://api.drupal.org/api/file/developer/examples/node_example.module/6/...