Is it possible to set number of values of an individual field in a compound field to "multiple"?

minghui.yu - November 4, 2009 - 23:39
Project:Content Construction Kit (CCK)
Version:6.x-2.5
Component:General
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I got a problem when developing a compound field (Drupal 6, cck 2). It has an Imagefiled, a few textarea/textfield/checkboxes, etc.

However, I realize that I must enable users to upload multiple images. The compound field as an entire field can be set to "unlimited" number of values , but not the individual field in the compound field.

In other words, all individual fields in this compound filed, other than the image field, can only have just one value; the compound field as a whole, can only have one value, too. But the image filed must be able to have unlimited number of values.

Is it possible to set number of values of an individual field in a compound field to "multiple"?

If this is not possible, my idea is to programmatically

1) Create a fieldset
2) create an imagefield
3) create a compound field
4) Put 2) and 3) in 1)

So in the fields setting page, it will show up as

My Fieldset Name
---- My Imagefield name
---- My compound field name

But the problem is that I find fieldset is content dependent. If I create a fieldset group_testgroup for content A, in the fields setting page for content B, fieldset group_testgroup is not available. In other words, all content types can have a fieldset named group_testgroup.

#1

markus_petrux - November 4, 2009 - 23:51

If only one of those fields needs to be unlimited, and the other fields just one possible value, then I think you can put these individual fields into a fieldgroup.

#2

minghui.yu - November 4, 2009 - 23:56

This module is developed for end users and it must be as simple/robust as possible. Particularly this module is a companion module for a complex theme, I worry that if I leave the job to create fields, fieldset to users, then if they make mistakes, the theme will not work.

That's why I want to programmatically create a compound field.

#3

markus_petrux - November 5, 2009 - 00:01
Status:active» fixed

Ah, so the answer to "Is it possible to set number of values of an individual field in a compound field to "multiple"? " is no, I'm afraid this is not possible.

On the other hand, you could perhaps export a content type that your users could import in their systems when installing your module. See the Content Copy module... or create the fieldgroup and its fields programmatically using the CRUD API provided by CCK. See the includes folder.

#4

minghui.yu - November 5, 2009 - 00:09

Thanks.

Export & Import sounds good. But I do not want to export & import the entire content type. Just the fieldset and fields I need.

#5

System Message - November 19, 2009 - 00:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.