Custom field for CCK

strokine - July 12, 2008 - 21:16

Hello,.. I'm trying to make a simple module which will add my own custom field type to CCK, so next time I'll create a new Content Type I'll have an option to use my own field.
I'm new to Drupal Module Development, so any help is greatly appreciated.
Here is what I done so far:
I've create .info file and .module file. Put all needed info into, .info file and those methodes into .module:

function bb_timecode_field_info() {
return array(
'bb_timecode' => array('label' => 'BBTV Time Code'),
);
}

function bb_timecode_widget_info() {
return array(
'bb_timecode' => array(
'label' => 'Time Code Field',
'field types' => array('bb_timecode'),
),
);
}

I install my module into Drupal 6.2 and enabled it.
Now, when I'm creating a new field for my custom content type, I'm able to select "BBTV Time Code" as a field type, click "Continue" button and select "Time Code Field". I save it, no problem so far.
But my Time Code Field should contain few text inputs in edit mode and show the values after.
What are the next steps? How I describe those text fields? I'm totally stack. Please advice.

Download and install a

MissyM - July 13, 2008 - 04:45

Download and install a similar CCK module. See if it works properly. Compare the your new module with the one that works. You should be able to figure it out form there.

 
 

Drupal is a registered trademark of Dries Buytaert.