1
votes

Is there a way to add one CCK field which consists of two separate fields, e.g. Author(s), having first name and last name on separate fields?

Thanks for any help!

3

3 Answers

0
votes

Show answer: not easily.

Long answer: yes, but with a bit of php trickery.

Look at this doc here, specifically, the lower "join" part will get you on the right track, but its specifically for 5.x. If you are working on 7.x this would be quite a bit different.

0
votes

You can use CCK 3.x for Drupal 6, which contains a sub-module called Multigroup, which allows you to take groups of fields (first name, last name for example), and repeat those groupings. However, before using this version of the module, note that it does not have an officially supported release, and its future is a bit uncertain.

0
votes

In addition to other suggestions, you could try Flexifield, or just have two different fields.

To make two fields end up looking like one...

  1. display them together later on using inline fields or by altering the template
  2. use Actions to join the two values together and save them to a different field, or
  3. use Computed Field to write them to another field on node save

Content Multigroup in CCK3 currently has no upgrade path to Drupal 7 and its interface is a bit clunky if you aren't planning on having a multi-value, multipart field.