Drupal custom CCK field with multiple child fields

Is there a way to create a composite field that can have multiple values, with each value having a different group of composite values?

eg. we want this structure to be at the end:

  • Group 1 (unlimited number of groups)
    • Children's field (unlimited number of children for each group)
    • child field
    • ...
  • Group 2
    • child field
    • child field
    • ...
  • ...

Is this even possible for a custom module that defines a CCK field? If so, can someone push me in the right direction?

+4
source share
4 answers

This is a very well-known and debated issue in the drupal world.

this function is called cck "multigroup", and it is quite difficult to implement. there are a lot of posts about this in the drupal forum, I suggest you start here:

http://drupal.org/node/494100

this is a kind of "hidden" function in the cck module. being in the module catalog, you will find instructions here:

SSK / modules / content_multigroup / README.txt
Edit: Current work on the multigroup module has moved to experimental CCK 3.0.

in the meantime, you can try to deal with this using the flexifield module (but this is a kind of hacking, I will not use it in production)

+5
source

As a result, I created my own CCK Cost / Product field based on this excellent tutorial with sample modules: http://poplarware.com/es/articles/cck_field_module

I have not yet figured out how to pull out a particular subfield, such as cost, in Views. I get the total connection ": $".

+3
source

For Drupal 7+, you probably want to check out the Field collection module or the " Field Group" if multiples are not needed.

+3
source

This problem is quite old, but I just survived it. I would think that the way to handle this now would be with the second type of cck for children, and groups as a node_reference field. So you will have:

Mastertype

  • Group field
    • unlimited per node
    • each link to a childtype node

Childtype

  • child field
    • unlimited per node
+1
source

All Articles