MultiValueField
No security coverage
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
....
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
Releases
| Version | Type | Core | Release date | |
|---|---|---|---|---|
| 2.0.0 | Stable | Jul 28, 2023 | ||
| 8.x-1.0-rc3 | Pre-release | Mar 16, 2023 |