0

I am trying to create custom compound field with a text field and a date popup.

I've tried the following code:

 $element['year'] = array(
    '#title' => t('date'),
    '#type' => 'select',
    '#default_value' => $options['year'],
    '#options' => $options,
    '#weight' => 2,
  );

...

function _universitydegrees_values_year() {
    $options = array(
        'year',
        1970, 
        1971, 
        1972,);
    return $options;
}

1 Answer 1

1

In Drupal 6 we had the Multigroup module, which was bundled as part of the CCK 3.x branch. As of comment #353 on the State of the multigroup module thread, you should be able to just swap your CCK 2.x code for the 3.x branch and run the updates without no problem. I used this module a few years ago and it worked fine.

Be advised however that apparently the CCK Multigroup module migration path to D7 is undefined. i.e., if you develop your site in D6 with CCK 3.x there's no guarantee that you will be able to automatically convert your CCK data to D7.

There are other Drupal 6.x field-grouping modules metioned here that you might find worth researching. This post also talks about different grouping modules and it might interest you.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.