6

Having come across the Field Collection module (FCM) on Drupal, I would like to know why one would use the FCM. I appreciate one may need to create different profiles for users (i.e. Teacher, Student, Campus) that may have cross-linked data, but I'm a little stumped in my mind why the FCM can help.

Can someone elaborate on what benefits the module can have, prior to me doing a fair amount of 'trial and error' work to find out how it can benefit. Anything to enlighten us on Field Collection would be most welcome.

3
  • Hello Paul :) I like your question, but there is a lot of text in there, that doesn't really help for most people finding this question in the future. Any chance you could cut it down? – Letharion May 27 '12 at 16:06
  • Thank for the reply. FC seems fine but I'll also check out the Relation module too. Thanks for the tips. Great to see NodeOne.se helping to again. – Paul B May 27 '12 at 20:50
  • Glad to be of help :) Did we stop at some point? :) – Letharion May 27 '12 at 21:19
7

There are several uses of field collection, but as the name implies, it's all about "Collecting fields" into groups.

I have a personal use case where I have a content type called "Project". Each project, can have several "subtask"s, and each subtask has a boolean, "completed".

If I have a normal multi-value field for "subtask", how do I conveniently stick a "complete" checkbox on to them? That would be it's own multi-value field, and there would be no connection between the data points, nor any easy way to theme the edit page to make them look like they belong together.

However, since "subtask" is actually a field-collection with a "name" and a "checkbox", they are logically grouped together, both in storage and in rendering.

If one want's a "quick" solution to a similar problem, then FC is an excellent module. However, if I were to build something serious, I would first consider if Relation can solve the problem instead. This will probably not always be the case, but with a bit of extra work, using relation instead of FC will yield a more flexible solution.

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.