4

I have a content type where I would like to use a field collection to group some fields (radio buttons and textfield). I need many of these on the content type with only the label being different.

I was hoping to make one field collection entity and have multiple instances of it on the one content type, but field collection does not support this.

Basically, I need many instances of a group of fields on a single content type. How can I accomplish this?

2
  • If Maximum number of values users can enter for each field in filed collection is 1, Then you can go for drupal.org/project/composed_field (composed field module). By this module you can reuse the existing "composed filed" – Krishna Mohan Feb 7 '14 at 6:09
  • This module presents me with the same problem as field collection. I can not reuse the same group of fields multiple times on the same content type – 2pha Feb 8 '14 at 10:32
1

There is an issue for that: https://drupal.org/node/1569970
You can try and help that issue get moving.

Or you can give up and create several Field Collection bundles. If you go down that route, you could possibly use Bundle Copy, but it doesn't currently support Field Collections. Luckily, there is an issue for that: https://drupal.org/node/1589118
And that issue has some patches and some testing, so I'd probably just try it.

2
  • yeh...I've seen the issue (and commented on it). I might have a go at patching the field collection module. – 2pha Feb 6 '14 at 8:08
  • Damn.... searching for the same thing over a years later. – 2pha Nov 18 '15 at 6:19
1

After trying a few different things this is what I ended up doing.

I set the field collection field on my node to allow 50. I used a form alter to put more numbers in the select box.

I then added my needed fields to this field collection including a dummy field with a default value so all the 50 rows are saved and displayed every time. (this dummy field is never displayed)

I then themed the field collection field table and mapped each row to a label in an array.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.