I am using the Link module for various things and it is working great. For another part of my site I want something similar. Sorry if I get the terminology wrong, but what I want is an N-tuple (i.e., a vector value, or a multi-field field).

The Link field is a tuple: it has a "Title" text entry and a "URL" text entry. The URL text entry gets validated by the Link module. I don't need the validation, I just want to have a flexible tuple field. I like the way that the link input form puts up two rows of entry boxes and has an "Add another item" entry box. I want that functionality as well.

For example, I have a content type called an "Assembly" that I want to have a "Sub-Assembly" field. Each sub-assembly needs a "Title", "Noderef", "Count", and "Notes". That's a 4-vector, aka 4-tuple. The Sub-Assembly field should also be able to have an arbitrary number values, using the "Add another item" to get the necessary input fields.

Can I use the CCK to get this functionality? Is there a module for it?

Comments

gbrands’s picture

Yeah there is a module for that and it happens to be CCK. However, that functionality is only in the 6.x-3-dev version (I also believe an alpha version was just launched). This will then provide an extra group setting called "multigroup." To use it in the way you described in your post, you would add your four fields and then group them with a multigroup. This would then give you your 'add more' functionality.

And to get them to appear side by side, just open up the group's configuration options and set it to table.

Hope this helps!

wuertele’s picture

OK, I installed 6.x-3.x-dev, enabled the multigroup module, created a multigroup typed group, then tried to move some fields into it, but I keep getting out of memory errors:

Fatal error: Out of memory (allocated 31195136) (tried to allocate 514857 bytes) in /drupal/includes/database.mysql.inc on line 301

1and1 only allows me 40MB for php (it actually might be less, but the status page reports 40MB). Do I need to start disabling modules?

wuertele’s picture

Alright, after deleting some modules I got rid of the out of memory error. At least until I tried including more than one multigroup with more than one sub-field each. Then there was nothing I could do to fix the memory problem.

Is this something that I should report to the CCK people? Or is the problem elsewhere?

no_idea_yet’s picture

The problem is with your host, you basically don't have enough memory:

PHP memory requirements can vary significantly depending on the modules in use on your site. Drupal 6 core requires PHP's memory_limit to be at least 16MB, and Drupal 7 core requires 32MB. Warning messages will be shown if the PHP configuration does not meet these requirements. However, while these values may be sufficient for a default Drupal installation, a production site with a number of commonly used modules enabled (CCK, Views etc.) could require 64 MB or more. Some installations may require much more, especially with media-rich implementations. If you are using a hosting service it is important to verify that your host can provide sufficient memory for the set of modules you are deploying or may deploy in the future. (See the Increase PHP memory limit page in the Troubleshooting FAQ for additional information on modifying the PHP memory limit.)

You'll need to increase the memory limit, and if they won't let you, find a new host.

wuertele’s picture

I solved the problem by turning off Views UI and Comments while I made the changes in Content Types. Given my situation I am stuck with 1and1 for the forseeable future. Sniff.

wuertele’s picture

Thanks! The dev CCK multigroup does EXACTLY what I was looking for, and it is working great!