1

I am creating an installation profile with multiple fields. For a 'file' field I want to change the number of values. I have two questions about this.

Is this an field setting or an instance setting? and what is the right way of changing this setting I tried these:

'number_values' => '2',
'max_value' => '2',
'max_values' => '2',
'values' => '2',
'value' => '2',

I can't find any of this on the internet. Any help and tips would be appreciated.

1 Answer 1

1

It's a field setting (cardinality), so assuming you're using field_create_field() to create it...

$field = array(
  'entity_types' => array('node'),
  'cardinality' => 2,
  'translatable' => FALSE,
  'locked' => FALSE,
  // etc...
);
field_create_field($field);

For unlimited values you can use the FIELD_CARDINALITY_UNLIMITED constant.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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