In the same way that I can create a text field using CCK and then configure this text field to have multiple values. Does anyone know if/how it would be possible to apply the same logic to groups of fields in CCK?

For instance I want to create a group of 3 text fields: Name, Intro, Description

I want to then make it possible so that multiple names, intros and descriptions can be added on the relevant 'create content' page.

Any thoughts? This stems from this discussion: http://drupal.org/node/230464

Thanks,

Comments

nevets’s picture

CCK comes with the fieldgroup module, if you enable that one the modules page you can then add groups to content types and then add fields to those groups.

David Stosik’s picture

Actually, those groups can't be "multiple", and that's what baronmunchowsen is asking for. ;)

baronmunchowsen’s picture

Thanks for the responses.

Any idea how those groups of fields could become multiple?

zeta ζ’s picture

I’ve just noticed that http://drupal.org/project/cck_fullname says:

This provides a prefix, first, middle, last, and suffix field as a single CCK field. my emphasis

Could this be a way to group fields together, by using a module?
___________________
It’s in the detaιls…

David Stosik’s picture

That's what I did a few months ago when I got the same answer as here... I needed an "Professional Experience" fieldgroup, composed of a title, a customer name, start and end dates, and a rich description, to be multiple inside a "Resume" node.
As nothing provided this feature (I heard CCK will allow this when released for Drupal 6...), I was obliged to develop my own "all-in-one" CCK Field.

David

baronmunchowsen’s picture

Thanks for these responses - it is very much appreciated. I will also check into Drupal 6's CCK functionality.

jinjyaa’s picture

Hi, sto,

This is very much the same sort of thing I need. But I'm fairly new to Drupal. Is there any chance you'd be willing to share your "all-in-one" CCK Field example with me? I promise not to pester you with questions.

I imagine a lot of people need this, and would be grateful for an example.

Ginger

baronmunchowsen’s picture

I'll be trying to implement this in a few weeks - and I'll happily post back any findings and that sort of thing

netron’s picture

how do you implement this "all in one" cck field group in D6?

nevets’s picture

An alternative approach, for the part where you want multiple fields as a group create a new content type with those fields, lets call it typeA. Before the next step add the 'Addnode' module, Now in the "main" type add a node reference field and use the 'Add Node List' widget type. Just a thought

baronmunchowsen’s picture

The addnode module is certainly something I will look at. Though I would rather not create a surplus of nodes in the system, this seems to be a very useful tool.

andershal’s picture

subscribing

Anonymous’s picture

subscribing

darrenmothersele’s picture

okeedoak’s picture

Subscribing

sifaan’s picture

me too :)

abloodworth’s picture

This seems to be a pretty common & necessary use case, and I'm pretty surprised Drupal doesn't (at least easily) support it. I'm working on this issue for my site and will post if I find a solution.

netron’s picture

i'm up against a brick wall with this one as well...

how do you implement a form where the user can enter multiple domains , or multiple previous jobs, or multiple places he/she visited?

its just a text field, with an "add new entry" icon or link... giving the user the ability to add multiple "lines" to a form dynamically... prior to submitting.

netron’s picture

not to worry. figured it out...
in D6 , you need to set the number of values on your cck field to "unlimited".

that'll trigger an Ahah "add more" button on your form.

baronmunchowsen’s picture

I have submitted a feature request for this on the fieldgroup module within CCK:

http://drupal.org/node/271226

j0rd’s picture

I think I'm going to implement a custom CCK type to get mine working right now, but it makes sense to be able to create a group of fields and then allow for multiple values of that group. Should be fairly easy to code as well.

Oh, here's a howto on how to create your own CCK type field.

http://www.darcynorman.net/2008/05/02/creating-a-custom-compound-field-f...

Cheers

---
Open Source Web Programming

dillonm’s picture

Unfortunately, that example is only for D5 -- I can't figure out what I need to do to get it up and running in D6 either. There is an article about Drupal 5.x to 6.x FormAPI changes (http://drupal.org/node/144132) but I couldn't figure out what all needed to be updated.

kulfi’s picture

subscribing

Terebinth’s picture

Subscribing

trzyem’s picture

Subscribing

Cybso’s picture

subscribing

Anonymous’s picture

Subscribing.

tran_tien’s picture

Subscribing

marcvangend’s picture

So many subscribers, so little answers...

I guess you will be happy to see this: http://drupal.org/project/flexifield. Flexifield is "still in early development", so coders, testers, developers and other smart people out there, give the developer a hand if you can.

Another intresting module is this one: http://drupal.org/project/education_field. It's not nearly as flexible as the flexifield solution, but it might be just what you need, or at least it can serve as a starting point for your own custom solution.

baronmunchowsen’s picture

Thanks so much for posting these links.

I have downloaded and tried out the flexifield mod (http://drupal.org/project/flexifield), and in the 15 minutes I had to play with it, saw real potential here as being the solution of the problem outlined in this thread. It effectively leverages the fields of other content types that you create, allowing you to 'embed' content types within one another, and create multiple values of those content type's fields, though without the overhead of creating surplus nodes.

I will be following the development of that module with a keen interest (and pitching in wherever I can) and I would urge others who have subscribed to this post to take a look too.

A good explanation of the mod can be found in this comment: http://drupal.org/node/292059#comment-955449.

gauravkumar87’s picture

subscribing

dydecker’s picture

subscribing

primalmedia’s picture

subscribing

marcvangend’s picture

A lot of work has been done in the past couple of weeks in this issue: http://drupal.org/node/119102.

singularo’s picture

Yet another subscriber ;-)

mattiasj’s picture

Subscribing

codevelopment’s picture

ditto

curagea’s picture

Subscribing. This feature is much needed for many things.

break9’s picture

subscribing

obrigado’s picture

subscribing

wdennen’s picture

thanks

davebv’s picture

thanks too

VeeLin’s picture

V

jeromebaum’s picture

sub

marcvangend’s picture

A real message between all subscriptions: marcus_petrux tells us that the CCK multigroup module is believed to be almost ready. I quote:

Please, test and report back any issues that you may find. This will help the CCK maintainers evaluate it all, and maybe we can count on it for a future CCK release.

So this is the moment to stop being subscribed and start testing. Thanks for contributing!

naxoc’s picture

Subscribe

WorldFallz’s picture

^^^^^

So this is the moment to stop being subscribed and start testing.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

melban’s picture

subscribing

hoogvlieger’s picture

Sorry if this solutions has already be mentioned. But I came across this site http://www.poplarware.com/cckfieldmodule.html There will probably be a decent solution in Drupal 7. But for now working with a a node reference will be sufficient.

BassPlaya’s picture

Subscribing

Authentically,
BassPlaya

Jordash’s picture

Subscribing, I had same question here: http://drupal.org/node/562502

WorldFallz’s picture

subscribing to what? As per the comment above, this module is now part of cck v3.

Jordash’s picture

Is CCK V3 Stable yet? Where can it be downloaded and how do I add the option of having multiple groups?

Aren Cambre’s picture

Here we are almost a year later and no CCK v3?

gauravary’s picture

Subscribing
My requirement is also the same for Drupal 5.16

gauravary’s picture

also I need to put taxonomy auto complete fields under every group.
Any thoughts?

WorldFallz’s picture

first thought is that should be a new thread, lol.

marcvangend’s picture

I wouldn't count on this for Drupal 5, especially now that Drupal 7 is appearing on the horizon.

WorldFallz’s picture

I have to agree with marc-- more than likely this isn't going to happen on d5. Besides the fact that d7 is around the corner, there were significant changes to cck between d5 and d6-- i'm not sure it's even possible.

BartVB’s picture

This seems to be a possible solution:

http://drupal.org/project/relativity

The example that's used in the documentation is a CD with multiple tracks.

cyrusvhadsupper’s picture

Add a new group of values with a AddNewGroup button would certainly be sweeeet; in my case the user should be able to add multiple work experiences...

phaijen’s picture

subscribing

aschiwi’s picture

For those who want multiple fieldgroups I can absolutely recommend CCK 6.x-3.x-dev (http://drupal.org/node/484068). I just thoroughly tested fieldgroups with textfields, textareas and imagefields inside an unlimmited fieldgroup.

kidsil’s picture

You have just ended 10 days of searching for the solution!

Thank you very much.

geniux’s picture

works like a charm, thanks for the heads up!!

nanL’s picture

I need too ...

WorldFallz’s picture

FYI, to follow this functionality for d7 see http://drupal.org/project/field_collection.

Funksmaname’s picture

CCK Groupfield would be perfect if it just had a 'number of values' setting, just like all other field types?? this would solve everything... is it that difficult to implement? (i'm not a developer btw otherwise i'd do it :P)

yevgeny.ananin’s picture

I know it's been a while. Is there any way to have several instances of a fieldgroup within a node?

marcvangend’s picture

As said, check http://drupal.org/project/field_collection. If that doesn't help, ask more specific questions.

wirka’s picture

Is there any solution? This feature is very necessary.

WorldFallz’s picture

Elin Yordanov’s picture

Field Collection is an overkill. All I want to have some field groups that can be multiplied with an 'Add more' button, like any field that can have unlimited values.

I don't want to create an entity for all field groups that I want to have in a node. This an overkill an it is not a good practice. Beside that it is incompatible with almost all modules, it is very hard to theme.

What I mean with incompatibility, you need to do a lot of unnecessary things to get the job done. Simplest example would be views, if you want to have the fields inside the field collection, you should add a relationship, which makes the query necessarily bigger. Another example would be the revisions that doesn't respect the fields inside the field collections since they are another entity! The examples can be listed pages long.

In short, field collection sucks as a solution to group a few fields together. The module itself can be useful in some cases, but it is not a valid solution for this problem! Drupal MUST have a better solution for such a simple need.

Old usernames: pc-wurm, Елин Й.

WorldFallz’s picture

All I want to have some field groups that can be multiplied with an 'Add more' button, like any field that can have unlimited values.

You make it sound like it's a matter of a couple of lines of code. As demonstrated by the various efforts to implement this functionality (ie see any of the cck v3 issues)-- it's not. field_collection is one attempt. Any attempt will add complexity and enlarge the query. A relationship is a join -- nothing more. There's no way to relate things (ie fields to fields or fields to nodes) without joins (the 'R' in RDBMS) unless you do it in a completely non-standard and hardcoded way.

Just because something is a 'simple need' doesn't mean it's a simple task. And I'm not sure who you're addressing when you say 'Drupal must...'. 'Drupal' is the community... including you. field_collection was created and submitted by someone who needed the functionality and was kind enough to make it available via drupal.org for free.

However, ymmv... feel free to prove me wrong and create the functionality you need with a method you approve of and submit to drupal.org.

Elin Yordanov’s picture

I am not trying to address someone, what I was trying to address is the fact of a problem/need that must have another simpler solution other than creating entities for every collection of fields. I find the module field collection itself also very useful in many cases and respect the contributers, as well all the Drupal community (including myself). All I wanted to state is in some cases that we need simply a few fields that can be tied together without creating another entity, the field collection is an overkill and makes the things unnecessarily complicated.

I thought this is a general discussion page, and I throw my two cents to keep people from trying to close the discussion by giving a link to field collection module.

Old usernames: pc-wurm, Елин Й.

marcvangend’s picture

There are (at least) two approaches to solve this problem. All software that intends to both be flexible and user friendly (such as the Field Collection module), will have add some overhead compared to solutions that are developer-centered and/or targeted at a single use case (eg. a custom compound field as described in http://www.phase2technology.com/blog/compound-fields-in-drupal-7).

I don't think it's fair to say that Field Collection is "overkill". It's just a different approach and it's up to the site builder to choose. IMHO, the fact that both approaches can exist side-by-side illustrates the strength of Drupal.

lekkanm’s picture

Field collection Module solve this requirement.