Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

MultiValueField

No security coverage Under active development 45 sites

This module allows you to add multiple values to a single field, storing all the values within that field. It's a lightweight alternative to modules like Paragraphs or Field Collection.

Multivaluefield

Multivaluefield (Multiple values field) is a drupal field plugin, allow to add multiple values on one field.

Drupal 9 ready.
Compatible with feeds.

Examples

Add / Create node programmatically with a "Multivaluefield" field

Example 1.

\Drupal\node\Entity\Node::create(array(
  'type' => 'page',
  'title' => 'Mvf testing page',
  'status' => 1,
  'field_mvf' => [
    'index' => 'Test index 1',
    '0' => "Fields Value 1",
    '1' => "Fields Value 2",
  ],
))->save();

Example 2.

(With $nid = Previously created node ID)

$entity = \Drupal\node\Entity\Node::load($nid);
$values = [
  'index' => 'Test index 2',
  '0' => "Fields Value 3",
  '1' => "Fields Value 4",
];
$entity->set('field_mvf', [$values, $values]);
$entity->save();

Similar Projects

- Paragraphs (https://www.drupal.org/project/paragraphs)
- Field collection (https://www.drupal.org/project/field_collection)

Different from the Paragraphs and Field collection

Lite-weight
Store all values in the same field (JSON)
Field configuration is stored on field storage configuration.
No need to create separate configurations
....

Drupal 8–10 · not 11

Ask your assistant about MultiValueField

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Mar 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
2.0.0 Stable 8–10 Jul 28, 2023
8.x-1.0-rc3 Pre-release 8–10 Mar 16, 2023