CCK Question

Events happening in the community are now at Drupal community events on www.drupal.org.
bradwanski's picture

Here is what I am trying to accomplish:

I have a content type, it is the name of an automotive manufacturer. I want to store information about all the cars that the manufacturer makes in this content type, in this example Honda. Now Honda has lots of different models of cars. So I have a CCK "group" where you can add a new model of car, which then has three fields (year_1, model_1, color_1). Then there is a button where you can "Add a new car" and it brings up three more fields (year_2, model_2, color_2), etc etc.

So instead of having to create 20 CCK "groups", only to have one or two used for a less popular manufacturer it dynamically adds the 3 new fields every time a content writer clicks the "Add a new car" button.

If this doesn't make sense I can explain more but essentially its identical to the photo upload functionality. Where the content writer can keep clicking "add another photo" to add as many, or as little photos they want.

Comments

There are 2 ways essentially

kgthompson's picture

There are 2 ways essentially that you could do this.

First of all, CCK 3, which is in development, gives you the option to create "multigroups" that would give you the functionality you desire. You can get the latest version of CCK3 here:

http://drupal.org/node/484068

Activate the content multigroup module in your modules page. This now gives you a second group type where you can put fields inside a group and define the group as having unlimited entries, like you can with fields.

Secondly you could define a second content type called "cars" and set up a nodereference to the manufacturer content type.

One possible solution...

d.clarke's picture

I'd recommend checking out content_multigroup. Its available in CCK 6.x-3.x which is still in dev but it is pretty good. If you search on d.o for content_multigroup you might find a rogue standalone module floating around too. Even though there isn't an official release yet it is pretty stable. I think it has been under development for around 2 years.

Thanks for the quick responses!

bradwanski's picture

I'll check out CCK 3 :)

San Diego DUG

Group categories

Event Classifications

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: