I'm trying to use CCK in a "modular" fashion, but running into some walls: I've created a content type which I'd like to contain 4 node reference fields, all of which are basically the same. I've created a generic node reference field type, but I cannot add this field type more than once to the same content type.

Perhaps I'm misunderstanding the way fields are used, but the section of the form where I customize how the field is displayed withing the specific content type make it feel like an "instance" of a defined field type. Yet I cannot select that field type again in order to customize it differently (give it a different name, etc) within the same content type.

From my current understanding of CCK, this seems like an obvious feature--why create multiple fields that are all effectively the same, when you can create one, and have multiple tweaked instances of it?

Is this just simply allowing an existing field type to still show up in the "Add existing field" select box, or (much more likely) is there something else going on that I'm missing?

Comments

KarenS’s picture

I'll take a stab at an answer and let someone correct me if I'm wrong. This is by design. A field instance is defined as a unique combination of a field and a content type, so by definition you can't have two of the same fields within one content type.

I agree that understanding multiple value fields seems odd -- but they really are for times when all the values really are multiple copies of exactly the same thing -- for instance multiple values from a field's select list. In fact, select lists are probably one of the best uses of them, although I have been doing things like setting up multiple email fields in a contact record (using a text field), since those don't each need their own labels and it makes sense to group them together on the node under a single label.

ashtonium’s picture

Category: feature » support

Ah, so in other words, I just need to check the multiple values box rather than trying to instance the same field multiple times. I see how that makes sense for a select box --turning it into a multi-select box.

With your multiple email fields example, however, checking the "multiple values" option for a text field simply makes 3 of them. There doesn't seem to be any option to specify exactly how many text fields you want in this case. Is there something else I'm missing here?

(changed category to support, as it seems the issue is with my understanding)

KarenS’s picture

That's the current behavior, but it might be a reasonable feature request to be able to specify a specific number, if that's what you are looking for. I'm not sure if that's what you want, but if so feel free to change this to a feature request.

ashtonium’s picture

Status: Active » Closed (fixed)

Yes, I think I will. I'll create it as a fresh feature request though, so it isn't clouded with my confusion. Thanks for taking the time to explain some things to me. --Marked as closed.