[support] Complex CCK data type - multiple fields

J-P Stacey jp.stacey at torchbox.com
Wed Jul 4 09:06:28 UTC 2007


Hi,

How would I go about building a complex CCK data type? The one I have in
mind might be e.g. the different formats available for a "book" node:

	Format		Width	Height	Depth	Weight
	----------------------------------------------
	Hardback	15cm	24cm	2cm	14oz
	Trade pback	14cm	22cm	1.5cm   10oz
	Paperback	10cm	15cm	1cm	6oz

Should I store each row as a flattened text field with delimiters e.g
"Hardback&15&24&2&14", and let hook_widget() unflatten it prior to
editing? Or can CCK store complex data types unflattened?

Given the form chunk to edit each row would be five input fields, can
hook_widget() cope with making this whole block "multiple" easily enough?
Would it need to be defined in form API as a multiple'd fieldset?

Cheers,
J-P


More information about the support mailing list