Drupal 7: How can I create a key/value field(or field group, if that's even possible)?

Posted by Su' on Stack Overflow See other posts from Stack Overflow or by Su'
Published on 2011-01-09T12:10:19Z Indexed on 2011/01/09 12:53 UTC
Read the original article Hit count: 130

Filed under:
|

Let's say I'm creating some app documentation. In creating a content type for functions, I have a text field for name, a box for a general description, and a couple other basic things. Now I need something for storing arguments to the function. Ideally, I'd like to input these as key-value pairs, or just two related fields, which can then be repeated as many times as needed for the given function. But I can't find any way to accomplish this.

The closest I've gotten is an abandonded field multigroup module that says to wait for CCK3, which hasn't even produced an alpha yet as far as I can tell and whose project page makes no obvious mention of this multi-group functionality. I also checked the CCK issue queue and don't think I saw it in there, either.

Is there a current viable way of doing this I'm not seeing? Viable includes "you're thinking of this the wrong way and do X instead." I've considered using a "Long text and summary" field, but that smells hackish and I don't know if I'd be setting myself up for side-effects. I'm new to Drupal.

© Stack Overflow or respective owner

Related posts about drupal

Related posts about drupal-7